views:

3917

answers:

2

I have a requirement to build a very simple streaming server. It needs to be able to capture video from a device and then stream that video via multicast to several clients on a LAN.

The capture part of this is pretty easy (in C#) thanks to a library someone wrote with DirectShow.Net (http://www.codeproject.com/KB/directx/directxcapture.aspx).

The question I have now is how to multicast this? This is the part I'm stuck on. I'm not sure what to do next, or what steps to take.

A: 

To achieve that you need to setup/write some kind of video streaming server.

I've used VideoCapX for the same purpose on my project. The documentation and support is not top notch, but it's good enough. It's using WMV streaming technology. The stream is called MMS stream. You can view it with any most media player. I've tested with Windows Media Player, Media Player Classics and VLC. If you would like to see it's capability without writing any code just yet, take a look at U-Broadcast, it uses VideoCapX to do the job behind the scene.

I've been using DirectShow.Net for almost 2 years, and I still find it hard to write a streaming server myself, due to the complexity of DirectShow technology.

Other than WMV, you can take a look at Helix Server or Apple Streaming Server. The latter one is not free, so is WMV Streaming Server from Microsoft.

You can also take a look at VLC or Windows Media Encoder to do streaming straight from the application. But so far I find U-Broadcast out do both of the above. VLC has some compatibility issue with codec and playback from non VLC player, WME has problem with starting up capturing device.

Good Luck

NOTE: I'm not associated with VideoCapX or it's company, I'm just a happy user of it.

faulty
VideoCaptureX looks like it only does capturing, not streaming. VLC is horribly broken; forum posters claim streaming is broken in the latest verison. Windows Media Encoder can't do multicast.
VideoCapX does streaming. I'm using version 6.3.Sorry, I just realized you're referring to "multicast". Well, video stream supports multiple connected clients. It couldn't really "multicast" because real multicast will require a much stringent network setup and all connection has to begin together.
faulty
You might want to look into multicast concept itself. http://en.wikipedia.org/wiki/IP_Multicast
faulty
+2  A: 

There are no filters available that you can plug and use.

You need to do three things here:

  1. Compress the video into MPEG2 or MPEG4
  2. Mux it into MPEG Transport Stream
  3. Broadcast it

There are lots of codecs available for part 1, and some devices can even output compressed video.

The part 3 is quite simple too.

Main problem goes with part 2, as MPEG Transport Stream is patented. It is licensed so that you cannot develop free software based on it (VLC and FFMPEG violate that license), and you have to pay several hundred dollars just to obtain a copy of specification.

If you have to develop it, you need to:

  • Obtain a copy of ISO/IEC 13818-1-2000 (you may download it as PDF from their site), it describes MPEG Transport Stream
  • Develop a renderer filter that takes MPEG Elementary Streams and muxes them into Transport Stream

It has to be a renderer as Transport Stream is not a transform filter. There are some kind of outband data (program allocation tables and reference clocks) that need to be sent on a regular basis, and you need to keep a worker thread to do that.

Quassnoi