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

Working with Compressors

Video data are compressed with different algorithms. These algorithms are implemented in special DLLs which are called VfW codecs. AviProcessor add-on automatically uses installed codecs to encode or decode AVI files. This article describes how to get information about codecs installed in the system.

Class Structure

In terms of AviProcessor add-on codecs are called compressors. The compressor is represented by the class Aurigma.GraphicsMill.Codecs.AviCompressor.

Working with Compressors

When you want to know what compressors are installed in the system you can use the static property named InstalledVideoCompressors. It returns the array of AviCompressor instances. You can use the following properties to get information about the compressor:

  • Fourcc property - gets the FOURCC code of the compressor (i.e. four-character string which identifies the compressor);

  • CompressorHandler property - gets the number, which identifies a codec. It is the same as FOURCC code but interpreted in numeric form rather than as string. The most frequently used and popular compressor handlers are defined as constants, e.g. AviCompressor.DivXPro5, AviCompressor.MSVideo1, AviCompressor.IntelV45, etc;

  • DefaultFramesPerSecond property - the quantity of frames used per second in the compressor by default;

  • DefaultQuality property - the quality, which is used by the compressor by default;

  • Description property - the description of the compressor;

  • DriverName property - the name of the DLL file which keeps the compressor;

  • SupportsEncoding property - defines whether the compressor supports encoding;

  • SupportsQuality property - defines whether the compressor allows to adjust the quality;

  • Version property - the version of the compressor.

If you know specific compressor handler or its FOURCC code, you can get an appropriate Aurigma.GraphicsMill.Codecs.AviCompressor instance using the static method GetVideoCompressor.

Note

If the compressor you want to get is not installed in the system the method GetVideoCompressor will return null.

The code snippet below illustrates how to list all compressors installed on the computer.

Visual Basic
Public Shared Sub EnumerateCodecs()

    Dim compressor As Aurigma.GraphicsMill.Codecs.AviCompressor
    For Each compressor In _
     Aurigma.GraphicsMill.Codecs.AviCompressor.InstalledVideoCompressors()

        Console.WriteLine("Name: {0} (ver. {1}) - {2} [FOURCC: {3}]", _
         compressor.DriverName, _
         compressor.Version, _
         compressor.Description, _
         compressor.Fourcc)
    Next

End Sub
C#
static public void EnumerateCodecs()
{
    foreach (Aurigma.GraphicsMill.Codecs.AviCompressor compressor in 
        Aurigma.GraphicsMill.Codecs.AviCompressor.InstalledVideoCompressors)
    {
        Console.WriteLine("Name: {0} (ver. {1}) - {2} [FOURCC: {3}]", 
            compressor.DriverName, 
            compressor.Version, 
            compressor.Description,
            compressor.Fourcc,
            compressor.CompressorHandler);
    }
}