Class for writing video files utilizing FFmpeg library.

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


public class VideoFileWriter : IDisposable


The class allows to write 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:

int width  = 320;
int height = 240;

// create instance of video writer
VideoFileWriter writer = new VideoFileWriter( );
// create new video file
writer.Open( "test.avi", width, height, 25, VideoCodec.MPEG4 );
// create a bitmap to save into the video file
Bitmap image = new Bitmap( width, height, PixelFormat.Format24bppRgb );
// write 1000 video frames
for ( int i = 0; i < 1000; i++ )
    image.SetPixel( i % width, i % height, Color.Red );
    writer.WriteVideoFrame( image );
writer.Close( );

Inheritance Hierarchy


See Also