Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I stream webcam video with C#? [closed]

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?

like image 606
The.Anti.9 Avatar asked Dec 05 '08 02:12

The.Anti.9


People also ask

Can you stream with any webcam?

In fact, just about any webcam will do for your broadcast. You can use the web camera that comes with your phone, tablet, or computer, or you can purchase a webcam that you plug into your device. You can also use professional cameras as well, although you will need a capture card and encoding equipment if you do.


1 Answers

If you want a "capture/streamer in a box" component, there are several out there as others have mentioned.

If you want to get down to the low-level control over it all, you'll need to use DirectShow as thealliedhacker points out. The best way to use DirectShow in C# is through the DirectShow.Net library - it wraps all of the DirectShow COM APIs and includes many useful shortcut functions for you.

In addition to capturing and streaming, you can also do recording, audio and video format conversions, audio and video live filters, and a whole lot of stuff.

Microsoft claims DirectShow is going away, but they have yet to release a new library or API that does everything that DirectShow provides. I suspect many of the latest things they have released are still DirectShow under the hood. Because of its status at Microsoft, there aren't a whole lot of books or references on it other than MSDN and what you can find on forums. Last year when we started a project using it, the best book on the subject - Programming Microsoft DirectShow - was out of print and going for around $350 for a used copy!

like image 143
CMPalmer Avatar answered Sep 20 '22 23:09

CMPalmer