C# Класс 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( );
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Dispose the object.

Описание методов

AVIReader() публичный Метод

Initializes a new instance of the AVIReader class.
Initializes Video for Windows library.
public AVIReader ( ) : System
Результат System

Close() публичный Метод

Close video file.
public Close ( ) : void
Результат void

Dispose() публичный Метод

Dispose the object.
Frees unmanaged resources used by the object. The object becomes unusable after that.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Dispose the object.
protected Dispose ( bool disposing ) : void
disposing bool Indicates if disposing was initiated manually.
Результат void

GetNextFrame() публичный Метод

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
Результат System.Drawing.Bitmap

Open() публичный Метод

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.
Результат void