How do I display an MJPEG stream in a Windows Form application?
19,888
Solution 1
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.
Solution 2
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
![malber](https://i.stack.imgur.com/CJslE.png?s=256&g=1)
Author by
malber
Updated on August 20, 2022Comments
-
malber almost 2 years
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.