Class for reading video files utilizing FFmpeg library.

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

Syntax

C#
public class VideoFileReader : IDisposable

Remarks

The class allows to read video files using FFmpeg library.

Note:Make sure you have FFmpeg binaries (DLLs) in the output folder of your application in order to use this class successfully. FFmpeg binaries can be found in Externals folder provided with AForge.NET framework's distribution.

Sample usage:

CopyC#
// create instance of video reader
VideoFileReader reader = new VideoFileReader( );
// open video file
reader.Open( "test.avi" );
// check some of its attributes
Console.WriteLine( "width:  " + reader.Width );
Console.WriteLine( "height: " + reader.Height );
Console.WriteLine( "fps:    " + reader.FrameRate );
Console.WriteLine( "codec:  " + reader.CodecName );
// read 100 video frames out of it
for ( int i = 0; i < 100; i++ )
{
    Bitmap videoFrame = reader.ReadVideoFrame( );
    // process the frame somehow
    // ...

    // dispose the frame when it is no longer required
    videoFrame.Dispose( );
}
reader.Close( );

Inheritance Hierarchy

System..::.Object
  AForge.Video.FFMPEG..::.VideoFileReader

See Also