DirectShow - Capture Webcam While Viewing It?

空扰寡人 提交于 2019-12-11 03:27:57

问题


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:

  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:

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

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