JPEG 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 JPEGStream : IVideoSource

Remarks

The video source constantly downloads JPEG files from the specified URL.

Sample usage:

CopyC#
// create JPEG video source
JPEGStream stream = new JPEGStream( "some url" );
// set NewFrame event handler
stream.NewFrame += new NewFrameEventHandler( video_NewFrame );
// start the video source
stream.Start( );
// ...
// signal to stop
stream.SignalToStop( );
// ...

private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
{
    // get new frame
    Bitmap bitmap = eventArgs.Frame;
    // process the frame
}

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

See Also