Last weeks I been busy with silverlight 4 and the new webcam support. My goal was recording the webcam stream and play it back in the silverlight application. However out-of-the-box silverlight 4 has no possibilities to record the stream. There is only a possiblity to take a snapshot and an api to get the raw bytes. Mike Taulty of Microsoft has tried to create a avi file. he blogged here. First i try to get the avi work in silverlight but found an easier manner. Since silverlight 3 it is possible to create custom decoder for the media element. So i wrote a custom videosink that writes the raw bytes to a memory stream. That memory stream is passed to a customer MultiMediaSource that provide the data for a media element.

you can download the source code here