Part 2 - DirectShow Filters, Definition and History
Here we go with the long awaited part 2 of this series. If you call 20-some hours a long wait.
(@The Geek: I will happily turn all of this bloviating into an article, as jmcguire also suggested.)
The term "codec" comes from encoder/decoder and even that is a bit of a misnomer. There are plenty of codecs that decode only and don't encode. For Microsoft Windows, the original video and audio decoder protocol was called Video For Windows (VFW). Back in Windows 3.x and Windows 9x, all of the codecs were VFW codecs and that's one of the reasons the name "codec" has hung around. Those who have been using Windows for a long time, may recognize the acronyms VFW or VCM as the codec standard from way back.
Around about the time of Windows XP, the VFW protocol was phased out and the new standard, DirectShow was phased in. DirectShow, originally called ActiveMovie, became part of DirectX along with DirectDraw, DirectSound, and so on -- everything had to start with "Direct". In the DirectShow (DS) interface, VFW codecs were replaced by DirectShow Filters. A "filter" refers to any component that accepts a stream of data for input, modifies the data in some way and outputs the new data stream. In theory, a DS Filter can perform any operation: encode, decode, transform, special effects, and so on. In practice, most DS Filters encode and/or decode which is why they are quite often confused with codecs. Filters are a superset of codecs. Unfortunately, VFW codecs have not vanished completely, so there are still codecs hanging around and adding to the confusion.
For the casual user, it's enough to know that DS Filters are the best way to decode video and audio streams for playback. When looking to play a particular video stream, a DS Filter is preferred over a VFW codec. The beauty of this scheme is that a program does not need to know how to handle every video stream, it only needs to know how to use the DS interface. If you need to play a new video type, just add the filter(s) required for it and *all* DS-aware applications on your system can play it, load it, edit it, or whatever they do. If a new type of video stream was released tomorrow and a DS Filter with it, all media applications that use DirectShow could immediately use the new video type with no modification. This gets back to the difference between the VLC and MPC media players. VLC includes built-in decoders that can handle most known video streams. MPC relies on DirectShow Filters to do all of the decoding work for it. VLC is convenient for those who don't wish to manage filters. MPC requires the filters to be in place. A user might have a video file that plays back in VLC, but not in any other application because VLC has a built-in decoder and there is no DS Filter on their system. This can become a crutch because this user will not learn about filters and it makes VLC seem like a wonder-app since it's the only one that can play the video. When you have DS Filters properly configured, you can playback video streams in MPC, edit them in Movie Maker, and load them in any other video player, editor, or what have you. Even VLC supports DirectShow!
DS Filters use a merit system. When more than one decoder is available for a given video or audio stream, the one with the higher merit value will be used. This allows a newer, better filter to supersede an older one. Or, enthusiasts can play around with changing merit numbers to test out different filters.
As with any system, there are some problems with DirectShow:
* The filter system has not been used to it's fullest potential. Most filters are basically glorified codecs.
* Many filter developers are lazy and sloppy with the codecs they put out, so that conflicts, crashes and instability can result.
* Microsoft has not done a good job of providing tools and information on DirectShow to users. Only developers are given their tools to view and modify filters and merit values.
* The merit system is poorly designed and even more poorly implemented by those lazy developers.
* As a result of this, the DirectShow ecosystem is somewhat delicate and easy to break.
All of this contributes to the understanding of why codec packs are bad news. They add too many filters (and VFW codecs, too) all at once from different sources -- some lazy developers and other responsible -- and then use kludgy merit numbers. The results is a disaster waiting to happen, or happening already.
Part 3 in the series will be about setting up DirectShow Filters on your windows system. I hope. :-)