MJPEG video source.

The video source downloads JPEG images from the specified URL, which represents MJPEG stream.

Sample usage:

// create MJPEG video source MJPEGStream stream = new MJPEGStream( "some url" ); // set event handlers stream.NewFrame += new NewFrameEventHandler( video_NewFrame ); // start the video source stream.Start( ); // ...

Some cameras produce HTTP header, which does not conform strictly to standard, what leads to .NET exception. To avoid this exception the useUnsafeHeaderParsing configuration option of httpWebRequest should be set, what may be done using application configuration file.

<configuration> <system.net> <settings> <httpWebRequest useUnsafeHeaderParsing="true" /> </settings> </system.net> </configuration>
Inheritance: IVideoSource
Example #1
0
        // Open MJPEG URL
        private void openMJPEGURLToolStripMenuItem_Click(object sender, EventArgs e)
        {
            URLForm form = new URLForm();

            form.Description = "Enter URL of an MJPEG video stream:";
            form.URLs = new string[]
			{
				"http://195.243.185.195/axis-cgi/mjpg/video.cgi?camera=4",
				"http://195.243.185.195/axis-cgi/mjpg/video.cgi?camera=3",
			};

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                // create video source
                MJPEGStream mjpegSource = new MJPEGStream(form.URL);

                // open it
                OpenVideoSource(mjpegSource);
            }
        }