DirectShow capturing to multiple files

不羁岁月 提交于 2019-12-02 10:12:13
Roman R.

This cannot be done in a single graph solution: changing a file requires transition through stopped state. Many filters don't even support dynamic reconnection.

Typical solution includes two filter graphs:

  1. Continuous capture, producing data without being ever stopped
  2. Per-file filter graph, receiving data from the first filter graph and routing it to a file.

You need a method to connect the two graphs so that the first one delivers data to the other. you might want to read up on GMFBridge, to either use it directly or get familiar with the concept.

See also (these and many other bridging related Qs, here and on MSDN DirectShow forum):

UPD. You don't have to use GMFBridge though. But you will have to do a similar thing anyway. Example - based on standard filters to maximal extent - might be: capturing through Sample Grabber Filter to Null Renderer Filter. Sample Grabber's callback copies data into input queue of custom source filter, based on PushSource Filter SDK sample, which is connected to File Writer Filter (through other filters) in the second graph.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!