views:

1212

answers:

1

First, some background:
I'm developing a Silverlight 3 application and want to add support for live streaming (webcam + microphone as input). Unfortunately, Silverlight cannot access a webcam or a microphone itself, so I need to create a stand-alone application for establishing the media stream. I guess Silverlight would work best with Microsoft technology, so I want to use the ASF format with WMV/WMA encoding.

After doing some research, here is what I think I could do:

  • It seems it is possible to capture both webcam and microphone input with DirectShow and then combine it into one "stream".
  • To encode the stream, I probably need to pass it to the Windows Media Format SDK libraries (MSDN documentation describes how to use DirectShow with WM ASF Writer).
  • I think it should be then possible to use something like "Network Sink" to broadcast the ASF stream (without writing it to the HDD).
  • I guess that connecting lots of clients to the stream would be quite heavy on bandwidth, so I should probably send the stream to a server and broadcast it from there. I just don't know if it's possible to use a combination of ASF Reader/Writer to "pass" the stream through the server. I also don't know if I could use multicasting to achieve a similar result.

I'm planning to use C#, although this probably doesn't make much difference as I will have to use some wrappers for C++ libraries anyway (like DirectShow.Net or SlimDX).

Unfortunately, I have virtually no experience with handling media streams. So my first question is, is it even possible to do streaming in the way I described?

And if it IS possible, is it a sensible way or should I consider using some different libraries/frameworks?

A: 

While using DShow and/or WMF SDK will give you the greatest amount of flexibility, if you only goal is to stream video/audio to Silverlight you can use something like Windows Media Encoder 9 or you can use the new Expression Encoder. Both support streaming live webcam and mic to a Windows Media Server publishing point or it can host the stream on a local port. Both have an SDK that is available via .NET (WME uses COM interop and Encoder has a native .NET API) This stream is compatible with Silverlight and Windows Media Player.

Jeremiah Morrill