vendredi 8 août 2014

DirectShow - Capture Webcam pendant que vous regardez il ? -Débordement de pile


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?




Things you should be aware of:



  1. Capture device is typically used exclusively, so can be used in a single graph

  2. 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:


Capture and Preview Filter Graph in DirectShow


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.



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?



Things you should be aware of:



  1. Capture device is typically used exclusively, so can be used in a single graph

  2. 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:


Capture and Preview Filter Graph in DirectShow


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.


0 commentaires:

Enregistrer un commentaire