views:

16535

answers:

4

I want to make a simple server application where people can connect using a browser-based client (which I will make later) to watch streaming video. And I want to use C#.

What do I need to capture video or rapid images through a webcam and send them over the network?

A: 

I've used VideoCapX for our project. It will stream out as MMS/ASF stream which can be open by media player. You can then embed media player into your webpage.

If you won't need much control, or if you want to try out VideoCapX without writing a code, try U-Broadcast, they use VideoCapX behind the scene.

faulty
+2  A: 

The usual API for this is DirectShow.

You can use P/Invoke to import the C++ APIs, but I think there are already a few projects out there that have done this.

http://channel9.msdn.com/forums/TechOff/93476-Programatically-Using-A-Webcam-In-C/

http://www.codeproject.com/KB/directx/DirXVidStrm.aspx

To get the streaming part, you probably want to use DirectShow to apply a compression codec to reduce lag, then you can get a Stream and transmit it. You could consider using multicast to reduce network load.

thealliedhacker
You can't really use P/Invoke to import the C++ API for DirectShow as it's COM based. You can use the DirectShow wrapper called DirectShow.Net.
faulty
+9  A: 
CMPalmer
Which book was that?
faulty
+1  A: 

You could just use VideoLAN. VideoLAN will work as a server (or you can wrap your own C# application around it for more control). There are also .NET wrappers for the viewer that you can use and thus embed in your C# client.

Chris Holmes