change recording file programmatically in directshow

前端 未结 3 1859
灰色年华
灰色年华 2021-01-16 09:38

I made a console application, using directshow, that record from a live source (now a webcam, then a tv capture card), add current date and time in overlay and then save aud

3条回答
  •  一向
    一向 (楼主)
    2021-01-16 10:12

    Well, I have the product (http://www.videophill.com) that does exactly what you described (its used for broadcast compliance recording purposes) - and I found that only way to do that is this:

    • create a dshow graph that will be used only to capture the audio and video
    • then, at the end of the graph, insert samplegrabber filters, both for audio and video
    • then, use IWMWritter to create and save wmv file, using samples fetched from samplegrabber filters
    • when time comes, close one IWMWritter and create another one.

    That way, you won't lose single frame when switching the output files.

    Of course, there is also question of queue-ing and storing the samples (when switching the writters) and properly re-aligning the audio/video timestamps, but from my research, that's the only 'normal' way to do it, and I used in practice.

提交回复
热议问题