问题
I am trying to make a webcam application in c# that allows users to record video. I have been using DirectShow.Net to preview the webcam and to take snapshots. But need to be able to capture video and audio while previewing the webcam at the same time. One thing I tried was using capturing multiple snapshots and converting them to a video using ffmpeg, however this obviously does not capture audio. Any ideas on how I could accomplish this?
回答1:
Things you should be aware of:
- Capture device is typically used exclusively, so can be used in a single graph
- Graphs change state as a whole, you cannot stop a part of the graph, esp. to start/stop recording separately from previewing
The simplest is to create a graph which does both recording and preview:
A more complicated scenario is to create 2 graphs for capture+preview and for recording and copy data from the first to the second, so that you could start/stop recording separately and seamlessly.
来源:https://stackoverflow.com/questions/12237577/directshow-capture-webcam-while-viewing-it