How can I add a preview stream to the graph without stopping it?

前端 未结 1 1870
悲&欢浪女
悲&欢浪女 2021-01-16 08:54

The problem is to build a capture graph supported three states:

  1. Preview only
  2. Capture to AVI-file only
  3. Combine

I have built the g

1条回答
  •  -上瘾入骨i
    2021-01-16 09:53

    Even though Dynamic Graph Building exists (see also Dynamic Reconnection), in most cases it is of little use:

    In most DirectShow filters, pins cannot be reconnected while the graph is actively streaming data. The application must stop the graph before reconnecting the pins. However, some filters do support pin reconnections while the graph is running, a process known as dynamic reconnection.

    Most likely the filters you are using would be incompatible with dynamic reconnection, or limiting extensibility. You might have other reasons to not use this approach, e.g. if you cannot afford delays and dropped data while dynamic operation is in progress.

    The typical solution involves two graphs: live (capture, preview presentation) and recording. You pass data between the two to make the work in sync. You might want to read up of graph bridging and GMFBridge.

    There are quite a few questions on this topic you might want to read as well:

    • Directshow Preview Only and Capture & Preview with a single Graph
    • DirectShow capturing to multiple files
    • change recording file programmatically in directshow

    0 讨论(0)
提交回复
热议问题