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?
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.
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.
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.
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.
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.
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.
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.
Another option to stream images from a webcam to a browser is via mjpeg. This is just a series of jpeg images that most modern browsers support as part of the tag. Here's a sample server written in c#:
https://www.codeproject.com/articles/371955/motion-jpeg-streaming-server
This works well over a LAN, but not as well over the internet as mjpeg is not as effcient as other video codecs (h264, VP8 etc..)
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.
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.
If you want to record video from within a web browser, I think your only option is Flash. We are looking to do the same thing. We are also primarily a .NET house and I don't see a way to use .NET to capture the webcam _from_within_the_browser_. All of the other solutions mentioned here would probably work great if you are happy to settle for a desktop app
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.
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.
If you want to record video from within a web browser, I think your only option is Flash. We are looking to do the same thing. We are also primarily a .NET house and I don't see a way to use .NET to capture the webcam _from_within_the_browser_. All of the other solutions mentioned here would probably work great if you are happy to settle for a desktop app
Another option to stream images from a webcam to a browser is via mjpeg. This is just a series of jpeg images that most modern browsers support as part of the tag. Here's a sample server written in c#:
https://www.codeproject.com/articles/371955/motion-jpeg-streaming-server
This works well over a LAN, but not as well over the internet as mjpeg is not as effcient as other video codecs (h264, VP8 etc..)
Source: Stackoverflow.com