DirectShow capturing to multiple files

后端 未结 1 1786
情书的邮戳
情书的邮戳 2021-01-27 08:08

I have a problem: I need to capture live source to file, but with every-minute slice (without loosing any frames). I think, I need some filter that can receive raw video at inpu

相关标签:
1条回答
  • 2021-01-27 08:49

    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):

    • GMFBridge usage in DirectShow
    • Directshow - Stop and close a file (but reuse graph and some filters)
    • When changing a file name, Recording Start is overdue for 3 seconds.
    • change recording file programmatically in directshow
    • DirectShow play two video files in a sequence?

    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.

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