Copyright © 2005-2023 MultiMedia Soft

Appendix B - Guidelines for DirectShow configuration through K-Lite

Previous pageReturn to chapter overviewNext page

As already mentioned inside the How to play video files through DirectShow tutorial, DirectShow includes by default a limited number of filters for decoding some common media file formats such as MPEG-1, MP3, Windows Media Audio, Windows Media Video, MIDI, media containers such as AVI, ASF, WAV, some splitters/demultiplexers, multiplexers, source and sink filters and some static image filters. However, DirectShow's standard format repertoire can be easily expanded by means of a variety of commercial and open source third-party filters. Such filters enable DirectShow to support virtually any container format and any audio or video codec.


One of the best packages containing most audio and video codecs for DirectShow is the K-Lite Codec Pack, a free collection of DirectShow filters, mostly open source, VFW/ACM codecs and tools available in both x86 and x64 versions. This package is updated quite frequently and really well supported and maintained. It can be downloaded for free from the following link.


Once installed, you can configure most aspects of DirectShow through a set of powerful but easy to use configuration tools. by default, the installation will create a menu item under the sequence "Start/All programs/K-Lite Codec Pack" (this sequence is for the English versions of Windows so it could look a bit different when using other languages); under this menu item you will find the following sub-items:


Media Player Classic: this is a multimedia application and a valid open source alternative to Microsoft's Windows Media Player
Codec Tweak Tool: this tool is the starting point to configure DirectShow codecs installed by K-Lite



Configuration: this sub-item allows accessing the configuration of each of the installed filters, like the set of LAV filters.
Help: contains K-Lite documentation
Tools: this sub-item contains a set of tools that can be useful when dealing with DirectShow.
Uninstall: allows uninstalling K-Lite and all related codecs, filters and tools from the system


IMPORTANT NOTE ABOUT X86 AND X64 VERSIONS OF WINDOWS: K-Lite Codec Pack comes with both x86 and x64 versions of its codecs and configuration tools so, when running on a x64 version of Windows, it's very important being sure that the x64 version is installed and that the configuration is performed using the x64 version of the configuration tools. It's also important to note that the availability of the x86 version of K-Lite could be still needed in case the container application should be compiled specifically for "x86", as in the case of application compiled through Visual Basic 6, and run on a x64 version of Windows.



As mentioned before, the Codec Tweak Tool is the starting point to configure DirectShow codecs installed:


The "DirectShow Filters" button under the "Configuration" section gives access to settings of each of the installed decoding/splitting filters





The "DirectShow (x86)" and "DirectShow (x64)" buttons under the "Codec and Filter management" section allows to enable/disable a specific filter





The "Preferred decoders" button under the "Win7DSFilterTweaker" section allows deciding, for a specific video format, which set of decoders should be preferred when building the video filters graph.






When dealing with Windows 7and higher version, default decoders like "MPEG VIDEO DECODER" for MPEG1 and "Microsoft DTV-DVD Video Decoder" for MPEG2 are not compatible with certain features of our component like adding the clip to a video mixer or loading a video clip from a memory buffer: for this reason these system default codecs are automatically blacklisted by our component: in case of need, you can disable this blacklist by using the VideoFiltersBlacklistDisable method.


The mentioned black-list can be expanded programmatically by adding other filters that you don't want to be used when generating the filters graph: this can be achieved through the VideoFiltersBlacklistItemAdd method; items in black-list can be removed at any time through the VideoFiltersBlacklistItemRemove method; the list can be reset through the VideoFiltersBlacklistReset method.