---
title: "Working with Compressors"
canonical: https://www.graphicsmill.com/docs/gm5/WorkingwithCompressors.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# 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](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_AviCompressor.htm.md).
 
## Working with Compressors
  
When you want to know what compressors are installed in the system you can use the static property named [InstalledVideoCompressors](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_AviCompressor_InstalledVideoCompressors.htm.md). It returns the array of AviCompressor instances. You can use the following properties to get information about the compressor:
 
- [Fourcc](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_AviCompressor_Fourcc.htm.md) property - gets the FOURCC code of the compressor (i.e. four-character string which identifies the compressor);
- [CompressorHandler](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_AviCompressor_CompressorHandler.htm.md) 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](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_AviCompressor_DefaultFramesPerSecond.htm.md) property - the quantity of frames used per second in the compressor by default;
- [DefaultQuality](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_AviCompressor_DefaultQuality.htm.md) property - the quality, which is used by the compressor by default;
- [Description](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_AviCompressor_Description.htm.md) property - the description of the compressor;
- [DriverName](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_AviCompressor_DriverName.htm.md) property - the name of the DLL file which keeps the compressor;
- [SupportsEncoding](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_AviCompressor_SupportsEncoding.htm.md) property - defines whether the compressor supports encoding;
- [SupportsQuality](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_AviCompressor_SupportsQuality.htm.md) property - defines whether the compressor allows to adjust the quality;
- [Version](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_AviCompressor_Version.htm.md) 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](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Codecs_AviCompressor_GetVideoCompressor.htm.md).
 
**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.
 
```
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
```
 
```csharp
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);
    }
}
```
