MJPEG video source.

Namespace:  AForge.Video
Assembly:  AForge.Video (in AForge.Video.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
public class MJPEGStream : IVideoSource

Remarks

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

Sample usage:

CopyC#
// 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( );
// ...

Note: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.

CopyC#
<configuration>
    <system.net>
        <settings>
            <httpWebRequest useUnsafeHeaderParsing="true" />
        </settings>
    </system.net>
</configuration>

Inheritance Hierarchy

System..::.Object
  AForge.Video..::.MJPEGStream

See Also