DirectShow Playback Guide:Filter Types
- further information: DirectShow Playback Guide
Generally speaking, there are three types of filters in terms of functionality: Source filters, Transform filters, and Render filters.
A Source Filter is a component that loads a media file for playback used to decode the container file format and extract the actual audio, video, metadata, and subtitle streams (among other information). They are usually somewhat specific to the file container type (though many Source filters handle multiple types). The most basic source filter simply loads a file and passes the stream contained in the file to downstream filters for further processing, but some source filter would act as a “splitter”, by parsing the data into separate audio and video streams and then pass them down to other filters. Examples of source filters are “File Source” which reads data from a file, “TV tuner filter” which tunes to a TV channel, and “DVD navigator filter” which reads data from a DVD disk. Another example is the Haali Media Splitter, which can decode MP4, AAC, and MKV files (among others).
A transform filter is a filter that accepts media data from an upstream filter, processes the data, and then passes the data to a downstream filter. Therefore a transform filter must have both input and output pins (there may be more than one set of input and output pins on a given filter). An input pin connects to the output pin of an upstream filter (such as a source filter, which generally has only output pins). An output pin on a transform filter connects to an input pin of a downstream filter , such as a renderer filter, which has only input pins, or another transform filter. Transform Filters are often called Decoder Filters or CODECS.
You don't always need to have a Transform filter in your render graph. For example, playing back a WAV file doesn't require a Transform/decoder filter, because the WAV format can be rendered directly by the Render Filter. The same goes for uncompressed video inside an AVI. Just because you don't need one, doesn't mean you can't however. It can be useful to use Transform filters to actually perform post-processing on media data. For example, you can use the FFDSHOW Video Decoder to do noise reduction, sharpening, and de-interlacing, among other processing tools. The FFDSHOW Audio decoder can process audio data for AC3 and DTS decoding, downmixing (and upmixing) multichannel audio, volume correcting, resampling, cleanup, and all sorts of other effects. These effects are available even for uncompressed audio and video -- you simply need to tell FFDSHOW to handle those media types.
Examples of Transform filters are the FFDSHOW MPEG-4 Video Decoder (ffdshow.ax), XviD Video Decoder (xvid.ax), the Microsoft MPEG Audio Decoder (quartz.dll), and DirectVobSub (VSFilter.dll).
A renderer filter is a component that renders a media stream, and is thus the last stage in DirectShow filter graph. For example an audio renderer is one that sends audio data to a sound card. A video renderer displays video to your computer screen. There are also renderers that can send files onto disk and into files. They are all usually very general purpose, accepting raw data.