views:

635

answers:

2

I would like to emulate video input from a webcam for testing purposes.

So I need to be able to emulate a software video capture device in Windows and be able to dynamically generate its output.

How can I achieve this?

I would prefer a solution in C# or C++.

+1  A: 

You can use a Virtual Webcam (old link, but there are others) it will take a video/images file and will display it in a webcam device. Your system will think that its a normal device.

Then you will need to create something that will generate the video/images, if you need static image then its pretty easy to generate a bmp.

Shay Erlichmen
This won't allow a program to generate 'live' video, though...
Adam Davis
He said dynamic not live, I imagine that in dynamic you have some model that you want to visualize at runtime but not necessarily in real time.
Shay Erlichmen
A: 

As far as I know, there is a set of COM interfaces that govern the recording and playback of audio and video in Windows. It used to be called DirectShow, but maybe in the meantime the name has been changed. Those interfaces are used to construct a graph of audio and video filters, to encode / decode the data stream.

The way to go: - read about the Microsoft DirectShow API, - implement a COM object that implements the video source interface,

qbeuek