Virtual Webcam in C++

早过忘川 提交于 2019-12-30 02:29:13

问题


I want to write a new virtual webcam driver, which for example will take an AVI or live stream for example for screen and stream it as webcam source.

I'll not have webcam really, I want to add a virtual webcam which streams desktop screen.

I should write a webcam in kernel mode to do so ? If so, could you guide me to a sample webcam driver?

If I should do it in DirectShow, how can I add a webcam device to list in webcams list in Control panel, so for example in Yahoo messenger, I can choose that device as webcam and stream my desktop as webcam images.

How can I get started?


回答1:


You need to write a DirectShow source filter. The Windows SDK contains a library called baseclasses which helps you developing such a filter. See CSourceStream for a good starting point.

To get the device to show up under the other Video Streaming Devices, you have to register your filter with the DirectShow API under the CLSID_VideoInputCategory. You don't need to/shouldn't write a kernel driver.




回答2:


You can get start with the sample "amcap" under DirectShow package, it is a excellent sample for beginner. If you want to list webcam devices, go to ChooseDevices() method.



来源:https://stackoverflow.com/questions/1596424/virtual-webcam-in-c

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