Question

I have a video stream which comes as an MJPEG over HTTP.

Is there a way to display such stream in a Windows Form application?

I already have a set of routines for displaying simple JPEGs from a webserver, but not continuous MJPEGs. Maybe the two problems are related.

Was it helpful?

Solution

I have found a library which works rather nicely: http://channel9.msdn.com/coding4fun/articles/MJPEG-Decoder

You can use it as follows in a C# solution

// class attribute
MjpegDecoder m_mjpeg;

// In the constructor
m_mjpeg = new MjpegDecoder();
m_mjpeg.FrameReady += mjpeg_FrameReady;

// Private method
private void mjpeg_FrameReady(object sender, FrameReadyEventArgs e)
{

        yourPictureBox.Image = e.Bitmap;
}

Source is also available for debugging.

OTHER TIPS

I know it's pretty late, but I found this solution that fits perfectly my needs and may be also yours.

here it is: Motion JPEG Streaming Server

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top