C# Class Accord.Video.VFW.AVIReader

AVI files reading using Video for Windows.

The class allows to read AVI files using Video for Windows API.

Sample usage:

// instantiate AVI reader AVIReader reader = new AVIReader( ); // open video file reader.Open( "test.avi" ); // read the video file while ( reader.Position - reader.Start < reader.Length ) { // get next frame Bitmap image = reader.GetNextFrame( ); // .. process the frame somehow or display it } reader.Close( );
Inheritance: IDisposable
Mostra file Open project: accord-net/framework Class Usage Examples

Public Methods

Method Description
AVIReader ( ) : System

Initializes a new instance of the AVIReader class.

Initializes Video for Windows library.

Close ( ) : void

Close video file.

Dispose ( ) : void

Dispose the object.

Frees unmanaged resources used by the object. The object becomes unusable after that.

GetNextFrame ( ) : Bitmap

Get next frame of opened video stream.

The method reads and returns the next video frame in the opened video stream at the position, which is set in Position property.

Open ( string fileName ) : void

Open AVI file.

The method opens a video file and prepares the stream and decoder for reading video frames with the help of GetNextFrame method.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Dispose the object.

Method Details

AVIReader() public method

Initializes a new instance of the AVIReader class.
Initializes Video for Windows library.
public AVIReader ( ) : System
return System

Close() public method

Close video file.
public Close ( ) : void
return void

Dispose() public method

Dispose the object.
Frees unmanaged resources used by the object. The object becomes unusable after that.
public Dispose ( ) : void
return void

Dispose() protected method

Dispose the object.
protected Dispose ( bool disposing ) : void
disposing bool Indicates if disposing was initiated manually.
return void

GetNextFrame() public method

Get next frame of opened video stream.

The method reads and returns the next video frame in the opened video stream at the position, which is set in Position property.

Thrown if no video file was open. A error occurred while reading next video frame. See exception message.
public GetNextFrame ( ) : Bitmap
return System.Drawing.Bitmap

Open() public method

Open AVI file.

The method opens a video file and prepares the stream and decoder for reading video frames with the help of GetNextFrame method.

Failed opening the specified file. A error occurred while opening the video file. See exception message.
public Open ( string fileName ) : void
fileName string AVI file name to open.
return void