Writing a virtual webcam?

后端 未结 1 640
日久生厌
日久生厌 2020-12-13 05:16

I need to create a virtual webcam that poses as a webcam, but takes as input a set of images that it plays. I have seen solutions like ManyCam, and Fake Webcam, but they all

相关标签:
1条回答
  • 2020-12-13 05:43

    You need to write DirectShow filter which is a COM server that implements an IPin, IAMStreamConfig and IKsPropertySet interfaces. For the IPin part you'd better to start by inheriting the CSourceStream class, for that you need to get the Windows SDK, having the SDK installed there would be a DirectShow Base Classes sources in samples\multimedia\directshow folder, there you'll find the CSourceStream (among many others). DllRegisterServer function of the COM server should register your filter within CLSID_VideoInputDeviceCategory category using filter mapper.

    After building the COM-server, you register it with regsvr32 tool, and your virtual webcam should appear in the web cam lists.

    Also check the samples\multimedia\directshow\filters\ball sample that can be improved and used as a starting point for your task.

    0 讨论(0)
提交回复
热议问题