About Compression Filters


A compression filter is a specialized type of transform filter. Compression filters (compressors) accept data, use a compression scheme to transform the data, and pass the compressed data downstream.

Contents of this article:

Microsoft® DirectShow™ includes an AVI Compressor filter and an ACM Wrapper filter, which will use any Video for Windows video or audio codec to compress data. You can write your own compressor filter if you need to compress data in a format that isn't supported by the default filters that DirectShow provides.

To begin writing a compression filter, write a transform filter that includes one input pin and one output pin. See the following articles for more information about writing a transform filter, because this article lists only the unique requirements of compression filters.

Registering a Compression Filter

Register your compression filter by using the AMovieDllRegisterServer2 function.

Necessary Compressor Interfaces

It is strongly recommended that you implement the IAMStreamConfig and IAMVideoCompression (video compressor only) interfaces on your output pin.

IAMStreamConfig enables you to inform applications about the formats to which you can compress data, and enables the application to configure your compressor to compress to a particular data type.

IAMVideoCompression enables an application set video-specific settings, like key frame frequency, that do not appear in the AM_MEDIA_TYPE structure.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.