This documentation is for the old version. Go to the latest Graphics Mill docs

AVI Processor Add-on Concepts

AVI Processor Add-on is an additional module for Graphics Mill for .NET. It enables you to add AVI files processing functionality to your application. This add-on is highly integrated with Graphics Mill for .NET and reuses a number of its classes and data types.

Features of AVI Processor Add-on

Most important features of AVI Processor Add-on are highlighted below. You can:

  • Get frames from AVI files to separate images;
  • Read parameters of the AVI file (such as duration, frames per second, etc);
  • Extract audio streams and save them as separate WAV files;
  • Create new AVI files;
  • Add frames to the AVI file (e.g. by loading them from separate image files, generating them with Graphics Mill, or extracting from another AVI file).
  • Specify different encoding options like frame per second, compression, quality, etc when creating new AVI file.
  • Add audio track from a separate WAV file or another AVI file. It is possible to append several audio files together.
  • Put a watermark on each frame added to the AVI file. It can be:
    • An image.
    • Current date/time.
    • Frame timing information.
  • Add transition effects between frames:
    • Stripe transition.
    • Fade out transition (changing transparency).
    • Custom transition.
  • Possibility to enumerate installed codecs and get information about them.

AVI Processor Add-on is based on Video for Windows (VfW) API. It means that it derives all limitations of Video for Windows. In particular, it does not support AVI files which contains DV Type-1 data streams. Also, AVI files cannot exceed 1GB.

AVI-related Classes

The structure of AVI Processor Add-on classes conform to general architecture of codecs of Graphics Mill for .NET. As for any other file format supported by Graphics Mill for .NET, the following classes are presented:

Additionally, the following AVI-related classes are also included:


This paragraph briefly describes how AVI Processor Add-on should be used. More detailed explanations can be found in subsequent sections.

To read the AVI file content, you should create the reader object and open it on this file (see the Open method for more details). After that you can extract frames either using foreach statement (the reader can be considered as a collection of frames in this case) or using the LoadFrame(Int32) method.


When you open the AVI file for reading, no data is actually loaded from it. The data is loaded only on demand, i.e. when you get the image from the frame. This way AVI Processor Add-on is memory-friendly.

However when the file is opened, it becomes locked by the application. No other application can remove or modify this AVI file. That's why it is highly recommended to close or dispose the reader object as soon as possible.

As soon as you get the frame, you can get the image stored in it. Use the GetBitmap(Bitmap) method to do it. It will return an instance of the Aurigma.GraphicsMill.Bitmap class. If you need to get a resized copy of this image, you can use the GetThumbnail(Bitmap, Int32, Int32) method instead. Also, you can get the dimensions and pixel format of the frame without loading the bitmap itself. It will be faster than receiving the bitmap first and retrieving appropriate properties from it.

If you need to extract the audio track, you need to get an audio manager object associated with the reader. You can do it using the AviReader.AudioManager property. It will return the Aurigma.GraphicsMill.Codecs.AviAudioManager class instance. It provides access to audio tracks (or streams) of the AVI file (note, one AVI file can contain several audio streams). To retrieve the number of audio streams in the AVI file, use the AudioStreamCount property. You can use this value to organize a loop to iterate each audio stream. All methods which retrieve the information about the audio stream require the number of the stream to get data for. Working with Audio Track topic provides more details on this.

To create new AVI file, you need to instantiate the writer object. After it you initialize the writer settings like compression handler (i.e. the number which identifies some codec, the same as FOURCC code, but in numeric form), etc. When the writer settings are initialized, you can open the writer on a new AVI file (it will be created automatically). As soon as the writer is opened, it is ready to be filled with the video data. Just call the AddFrame(IFrame) method for each frame you want to add. To put the image (Aurigma.GraphicsMill.Bitmap instance) into the frame, use the SetBitmap(Bitmap) method of the frame object.

If you need to add audio streams to the AVI file, you should use the AviWriter.AudioManager property. It will return the same Aurigma.GraphicsMill.Codecs.AviAudioManager object, but this time you should use AddAudioStream and AppendAudioStream methods to add/append the audio data. Note, audio data should be added after you put all necessary video data.


As soon as you finished adding frames to the writer, you need to close the writer with the Close() method. It will unlock the file and flush all unsaved data.

See Also