Difference between revisions of "DirectShow Playback Guide"

From JRiverWiki
Jump to: navigation, search
(FLV)
 
(129 intermediate revisions by 11 users not shown)
Line 1: Line 1:
Native DirectShow filter support [http://yabb.jriver.com/interact/index.php?topic=30561.0 was added to MC11.1 in December 2005] and has been improved drastically with MC12.  [http://en.wikipedia.org/wiki/Directshow DirectShow] is a multimedia [http://en.wikipedia.org/wiki/Application_programming_interface API] released by Microsoft which became a standard component of Windows with Windows 98.  It is essentially a replacement for the earlier [http://en.wikipedia.org/wiki/Video_for_Windows Video for Windows] technology.  In Windows Vista this technology has evolved into the [http://en.wikipedia.org/wiki/Media_Foundation Windows Media Foundation], which performs similar services.  It provides developers with a unified interface across different programming languages to allow their applications to render or record media files, using a filter based framework.
+
'''IMPORTANT NOTE:  MC16 introduced [[Red October]], a simple and reliable way of using DirectShow filters.  Select Red October Standard under video options.  The following is needed mainly for earlier versions of MC.'''
 +
 
 +
Native DirectShow filter support [http://yabb.jriver.com/interact/index.php?topic=30561.0 was added to MC11.1 in December 2005] and has been improved dramatically with MC12.  [http://en.wikipedia.org/wiki/Directshow DirectShow] is a multimedia [http://en.wikipedia.org/wiki/Application_programming_interface API] released by Microsoft which became a standard component of Windows with Windows 98.  It is essentially a replacement for the earlier [http://en.wikipedia.org/wiki/Video_for_Windows Video for Windows] technology.  In Windows Vista this technology has evolved into the [http://en.wikipedia.org/wiki/Media_Foundation Windows Media Foundation], which performs similar services.  It provides developers with a unified interface across different programming languages to allow their applications to render or record media files, using a filter based framework.
  
 
[[Image:Mc12 directshow options.jpg|thumb|right|350px|MC12 has greatly expanded DirectShow playback configuration options and support.]]
 
[[Image:Mc12 directshow options.jpg|thumb|right|350px|MC12 has greatly expanded DirectShow playback configuration options and support.]]
  
 
= What is DirectShow? What is a DirectShow filter? =
 
= What is DirectShow? What is a DirectShow filter? =
 
  
 
Media Center plays many media formats in DirectShow, including DVD and many video and audio files. DirectShow is a Microsoft technology for playing (and recording) audio/video media on a Windows computer.
 
Media Center plays many media formats in DirectShow, including DVD and many video and audio files. DirectShow is a Microsoft technology for playing (and recording) audio/video media on a Windows computer.
  
DirectShow uses the concept of “Filter Graph” to take a multimedia file on disk and turn it into what you see or hear from your computer.  A filter graph is like a chain of individual “DirectShow Filters”.  A filter is a software component in DirectShow that will work with other similar components to render a media file.  They are sort of like little "plugins" for DirectShow that allow it to handle different types of media, different types of files, or perform transformations on the media data.  Each filter in the Filter Graph chain processes audio/video data in a specific way to facilitate the playing of the media files.  Filters have “pins” - points of connection between filters, both input pins and output pins. Pins are the means by which media data is passed from one filter to another filter.  For example, the Input pin of the [[DirectShow_Playback_Guide#MPEG-4_Container_Family_mp4_.2F_m4a_.2F_m4v|Haali Media Splitter]] will receive the data from the file, split it to it's component parts and then output those "streams" via it's output pins.  [[DirectShow_Playback_Guide:Alternative_Filters#FFDSHOW|FFDSHOW]] will then connect it's input pins to Haali's output pins and decode the video stream.
+
DirectShow uses the concept of “Filter Graph” to take a multimedia file on disk and turn it into what you see or hear from your computer.  A filter graph is like a chain of individual “DirectShow Filters”.  A filter is a software component in DirectShow that will work with other similar components to render a media file.  They are sort of like little "plugins" for DirectShow that allow it to handle different types of media, different types of files, or perform transformations on the media data.  Each filter in the Filter Graph chain processes audio/video data in a specific way to facilitate the playing of the media files.  Filters have “pins” - points of connection between filters, both input pins and output pins. Pins are the means by which media data is passed from one filter to another filter.  For example, the Input pin of the [[DirectShow_Playback_Guide#MPEG-4_Container_Family_mp4_.2F_m4a_.2F_m4v|Haali Media Splitter]] will receive the data from the file, split it to it's component parts and then output those "streams" via it's output pins.  [[DirectShow_Playback_Guide:Alternative_Filters#FFDSHOW|FFDSHOW]] will then connect it's input pins to Haali's output pins and decode the video stream.
  
 
You can use the [http://en.wikipedia.org/wiki/Graphedit free GraphEdit utility from Microsoft] to manually build filter graphs if you want to play around with how this works.
 
You can use the [http://en.wikipedia.org/wiki/Graphedit free GraphEdit utility from Microsoft] to manually build filter graphs if you want to play around with how this works.
  
[[Image:GraphEdit_Example-fullsize.jpg|thumb|none|650px|GraphEdit with a x264 compressed MKV file loaded, showing the default filter graph]]
+
[[Image:GraphEdit_Example-fullsize.jpg|thumb|none|650px|GraphEdit with a x264 compressed MKV file loaded, showing the default filter graph.<br>The pins are the connections between the different filter boxes, with outputs on one end and inputs on the other.]]
  
 
== Filter Types ==
 
== Filter Types ==
  
Generally speaking, there are three types of filters in terms of functionality: Source filters, transform filters, and renderer filters.
+
:''further information:'' [[DirectShow_Playback_Guide:Filter_Types|DirectShow Playback Guide: Filter Types]]
 
 
With most media files, it is important to understand the distinction between the [http://en.wikipedia.org/wiki/Container_format file container format] and the individual media stream formats (sometimes referred to as the [http://en.wikipedia.org/wiki/Codec codec] of the file) "contained" inside the file.  The container format is essentially the file you see on your hard drive (the AVI, MKV, MP4, OGM, or whatever) which is used to identify and interleave the different "stream" types that make up the actual media, including metadata tags, video streams, audio streams, subtitles, and other information.
 
 
 
To play back a file properly via DirectShow you always need at least a Source Filter and a Render filter.  Usually you need both a Source Filter, one or more Transform filters, and one or more Render Filters.  The Source Filter (often referred to as the Splitter Filter) reads the file container format and splits out the different "streams" of data contained within.  This data is usually then passed over to a set of Transform filters which decode the data streams.  These Transform filters are often called Decoder Filters, or Codecs (which stands for enCODer/DECoder).  The Transform filters decode the different media streams (including audio, video, and metadata, such as subtitles).  Generally you'll need one decoder filter to process each "stream type" that comes out of the Source Filter (though many, like [[DirectShow_Playback_Guide:Alternative_Filters#FFDSHOW|FFDSHOW]], handle more than one type of stream).  They then pass the raw decoded data to the Render filters which transforms the uncompressed raw data into what you see on screen and hear through your sound device.
 
 
 
Sometimes these lines blur, when a particular filter can act as both a splitter and a decoder filter (such as FFDSHOW), or Haali which also processes and decodes some of the data streams (subtitles for example).
 
 
 
[[Image:GraphEdit_Example-Labelled.jpg|thumb|right|650px|GraphEdit with a the filters labeled.]]
 
 
 
=== Source 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 [[DirectShow_Playback_Guide#MPEG-4_Container_Family_mp4_.2F_m4a_.2F_m4v|Haali Media Splitter]], which can decode MP4, AAC, and MKV files (among others).
 
 
 
=== Transform Filters ===
 
  
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.
+
Generally speaking, there are three types of filters in terms of functionality: ''Source'' filters, ''Transform'' filters, and ''Render'' filters.
  
You don't always need to have a Transform filter in your render graphFor 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 [[DirectShow_Playback_Guide:Alternative_Filters#FFDSHOW|FFDSHOW]] Video Decoder to do noise reduction, sharpening, and de-interlacing, among other processing toolsThe [[DirectShow_Playback_Guide:Alternative_Filters#FFDSHOW|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 effectsThese effects are available even for uncompressed audio and video -- you simply need to tell [[DirectShow_Playback_Guide:Alternative_Filters#FFDSHOW|FFDSHOW]] to handle those media types.
+
Before explaining what these different types of filters do, it is useful to understand a bit more about how multimedia content is stored in files on diskWith most media files, there is a distinction between the [http://en.wikipedia.org/wiki/Container_format file container format] and the individual media stream types (sometimes referred to as the [http://en.wikipedia.org/wiki/Codec codec] or the [http://en.wikipedia.org/wiki/Fourcc FourCC] of the file) "contained" inside the file.  The container format is essentially the file you see on your hard drive (the AVI, MKV, MP4, OGM, or whatever) which is used to identify and interleave the different media stream types.  It is the individual media streams inside the container which make up the actual media, including metadata tags, video streams, audio streams, subtitles, and other informationSo, wrapped up inside the AVI or MP4 file there will be one or more different types of media, usually compressed with a codec of some typeA codec is a special type of filter (or other similar software) that can both encode a media stream to a compressed format, and decode a stream from that same compressed format -- a COmpressor/DECompressor, which is how it gets its name.
  
Examples of Transform filters are the [[DirectShow_Playback_Guide:Alternative_Filters#FFDSHOW|FFDSHOW]] MPEG-4 Video Decoder (ffdshow.ax), XviD Video Decoder (xvid.ax), the Microsoft MPEG Audio Decoder (quartz.dll), and DirectVobSub (VSFilter.dll).
+
[[Image:GraphEdit_Example-Labelled.jpg|thumb|right|650px|GraphEdit with the filters labeled.]]
  
=== Render Filters ===
+
To play back a file properly via DirectShow you always need at least one Source Filter and one Render filter.  Usually, however, you need one Source Filter, one or more Transform filters, and one or more Render Filters.  The Source Filter (often referred to as the Splitter Filter) reads the file container format and splits out the different "streams" of data contained within.  This data is usually then passed over to a set of Transform filters which decode the different media streams (including audio, video, and metadata, such as subtitles).  These Transform filters are often (somewhat erroneously) called Decoder Filters, or Codecs (which stands for enCODer/DECoder), because they often take care of decompressing the media.  Because uncompressed video footage is incredibly huge, compression is almost always used to keep file sizes lower.  Generally you'll need one decoder filter to process each "stream type" that comes out of the Source Filter (though many, like [[DirectShow_Playback_Guide:Alternative_Filters#FFDSHOW|FFDSHOW]], handle more than one type of stream).  They then pass the raw decoded data to the Render filters which transforms the uncompressed raw data into what you see on screen and hear through your sound device.
  
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.
+
Sometimes these lines blur, when a particular filter can act as both a splitter and a decoder filter (such as FFDSHOW), or Haali which also processes and decodes some of the data streams (subtitles for example). Also, when you play back uncompresed media (such as an uncompressed audio track) you do not always have a transform filter and the source pin connects directly to the render filter.
  
 
== How DirectShow Decides Which Filters to Use ==
 
== How DirectShow Decides Which Filters to Use ==
Line 70: Line 57:
 
= Why do I need to get DirectShow filters? =
 
= Why do I need to get DirectShow filters? =
  
In short, you don't but you'll probably want to!  The entire purpose of DirectShow is to allow the system to easily expand to support new media types through the "plug-in" Filter architecture.   
+
In short, you don't ''need to'', but you'll probably ''want to''!  The entire purpose of DirectShow is to allow the system to easily expand to support new media types through the "plug-in" Filter architecture.   
 +
 
 +
In order to play media files in DirectShow, one must have DirectShow filters that can handle the media types to be played. DirectShow comes with some of the filters that are needed, for example video and audio renderers and MPEG-1 filters. DirectShow, however, does not include all filters that are needed to handle common (and more modern) media types.  So, you must make sure you have appropriate filters for the file types you want to play. DirectShow filters come from a variety of sources. We do not, and can not, include all filters that are needed in Media Center‘s installation.  In most cases you will need to install decoder filters from other sources. For example in order to play DVD on your computer you must have DVD capable MPEG-2 video decoder, and audio decoder(s) that are capable of decoding MPEG-2 audio and/or AC3 audio formats.
  
In order to play media files in DirectShow, one must have DirectShow filters that can handle the media types to be played. DirectShow comes with some of the filters that are needed, for example video and audio renderers and MPEG-1 filters. DirectShow, however, does not include all filters that are needed to handle common (and more modern) media typesSo, you must make sure you have appropriate filters for the file types you want to play. DirectShow filters come from a variety of sources. We do not, and can not, include all filters that are needed in Media Center‘s installation.  In most cases you will need to install decoder filters from other sources. For example in order to play DVD on your computer you must have DVD capable MPEG-2 video decoder, and audio decoder(s) that are capable of decoding MPEG-2 audio and/or AC3 audio formats.
+
Another important example is [[MP4_and_M4A_File_Support|M4A audio files]]. M4A files are simply MP4 files that contain only an audio stream (usually AAC encoded).  In order to play these files back you need to either have Quicktime Player installed, or you need to install the proper DirectShow filters and enable DirectShow M4A support. Generally, DirectShow playback will give better results for M4A files, but because most people have Quicktime installed already, MC disables DirectShow support in favor of Quicktime by default.
  
 
Some computers do come with certain filters installed by the computer vendor. However, the filters preinstalled may not be top-notch filters. In such case it is to your advantage to find and install better filters..
 
Some computers do come with certain filters installed by the computer vendor. However, the filters preinstalled may not be top-notch filters. In such case it is to your advantage to find and install better filters..
Line 79: Line 68:
  
  
It depends on the filter. Some filters come with an installation program. You just need to execute the program, and the installation wizard will guide you through the process. Most filter packs are installed this way.
+
It depends on the filter. Some filters come with an installation program. You just need to execute the program, and the installation wizard will guide you through the process. Most filter packs are installed this way, via the standard "setup.exe" Windows software installation motif.  Then, to remove them, you just go the the standard ''Add/Remove Programs Control Panel'' and proceed normally.
 +
 
 +
Unfortunately, not all  filters come with an installation wizard. Instead they are just one or more files with file extension .ax or .dll, often contained in an archival file (ZIP or RAR). In such a case, you first need to extract the file(s) into a folder where you'll be able to find them using a program like [http://www.zipgenius.it/ ZipGenius] or [http://www.winzip.com/ WinZip].  Any folder is fine, really, but I like to use ''C:\Program Files\DirectShow_Filters\'' (because it's then easy to find the filters later if I need to uninstall or update them).
 +
 
 +
Once you've extracted the filter files to an appropriate folder, you then need to register the filter using the Windows program ''Regsvr32.exe''. This program exists on every Windows computer in your System32 directory (inside the Windows folder). To do this, simply call the regsvr32.exe program and give it the path to your new filter as its command line argument.
 +
 
 +
For example, if you downloaded a filter whose file name is '''NewFilter.ax''', and you placed the file in <code>"€œC:\Program Files\DirectShow_Filters\"</code>€œ, you can register it by going to the Start button and choosing <code>"€œRun"</code>€.  Then enter the following line (including quotes) in the box that appears:
 +
 
 +
<code>regsvr32.exe "C:\Program Files\DirectShow_Filters\newfilter.ax"</code>
 +
 
 +
When you click OK a dialog box should pop up saying <code>"DLLRegisterServer in C:\Program Files\DirectShow_Filters\newfilter.ax succeeded"</code>, indicating that the filter is now registered with the system.  That's it!  You've now successfully installed the filter.
  
Not all  filters come with an installation wizard. Instead they are just one or more files with file extension .ax or .dll, often contained in an archival file (ZIP or RAR). In such a case, you can first extract the file(s) into a folder (any folder is fine, for example “C:\Program Files\DirectShow Filters\“ would be a good choice). Then register the filter using Windows program Regsvr32.exe. This program exists on every Windows computer. For example, if you downloaded a filter whose file name is NewFilter.ax, and you place the file in “C:\Program Files\DirectShow Filters\“, you can register it by clicking Start button and choose “Run…” command and enter the following line (including quotes):
+
[[Image:Regsvr32 success.jpg|thumb|none|550px|Successfully registered FLVSplitter.ax to enable FLV Video playback in MC!]]
  
regsvr32.exe "C:\Program Files\DirectShow Filters\newfilter.ax"
+
'''NOTE 1:''' Some filters may come with two versions of them, a Unicode version and a non-Unicode verion. You should register the Unicode version as Media Center supports Unicode.
  
and click OK. A dialog box should pop up saying "DLLRegisterServer in C:\Program Files\DirectShow Filters\newfilter.ax succeeded", indicating that the filter is now registered with the system.
+
If you ever decide you don't need a particular filter anymore, you can also unregister a filter in much the same manner, by using the command line parameter ''/U''. For example to unregister the filter registered in the above example, you issue this command:
  
Some filters may come with two versions of them, a Unicode version and a non-Unicode verion. You should register the Unicode version as Media Center supports Unicode.
+
<code>regsvr32.exe /U "C:\Program Files\DirectShow_Filters\newfilter.ax"</code>
  
You can also unregister a filter, in case you decide you no longer need the filter, by using the command line parameter /U. For example to unregister the filter registered in the above example, you issue this command:
+
In this case you will get a confirmation saying “DllUnRegisterServer in C:\Program Files\DirectShow Filters\newfilter.ax succeeded.”  You are then free to delete the filter file(s) from your system.
  
regsvr32.exe /U "C:\Program Files\DirectShow Filters\newfilter.ax"
+
'''NOTE 2:''' On Windows Vista and higher, registration/unregistration of filters is done slightly differently. Instead of choosing <code>"€œRun"</code>, you go to Start > All Programs > Accessories, and '''right-click''' <code>"Command Prompt"</code> and choose <code>"Run as administrator"</code>. When the command prompt opens, type the following command
  
You will also get a confirmation saying “DllUnRegisterServer in C:\Program Files\DirectShow Filters\newfilter.ax succeeded.”
+
<code>regsvr32.exe "C:\Program Files\DirectShow_Filters\newfilter.ax"</code>
  
 +
and press enter.  You will get the same confirmation as described above.
  
 
= What filters do I need and where do I get them? =
 
= What filters do I need and where do I get them? =
Line 106: Line 106:
 
[[Image:Cccp configuration-page1.jpg|thumb|right|400px|CCCP's Configuration Utility (first page).]]
 
[[Image:Cccp configuration-page1.jpg|thumb|right|400px|CCCP's Configuration Utility (first page).]]
  
[http://www.cccp-project.net/ CCCP Home Page]
+
[http://www.cccp-project.net/ The Combined Community Codec Pack (CCCP)] is a great multiple-filter pack that provides filters for [http://www.cccp-project.net/wiki/index.php?title=FAQ#Supported_Formats playback of most media formats], including full DVD playback support out-of-the-box. At the heart of CCCP is [[DirectShow_Playback_Guide:Alternative_Filters#FFDSHOW|FFDSHOW]], which is a general purpose DirectShow filter that can be used to decode a large number of media formats.  CCCP also includes quite a few other major components, including: MPV video decoder (decodes DVD and other MPEG-2 video), and Haali Media Splitter (handles decoding MP4, MKV, M4A, and a number of other container formats).  CCCP uses custom settings for and custom versions of many of the individual codecs and filters which make up the pack, so installing CCCP is a better solution than installing the components separately.
 +
 
 +
This "pack" is probably the simplest method to get most file types to play back reliably.  There are a few file types that CCCP does not support out of the box.  These include Quicktime, RealMedia, and FLV video (though it tries at FLV).  Adding support for these file types is described below, though the [http://www.cccp-project.net/wiki/index.php?title=FAQ#UnSupported_Formats CCCP Project site] has much more information on this topic.  [http://www.cccp-project.net/wiki/index.php?title=FAQ#What_is_the_CCCP.3F As described on their wiki], the CCCP was created "to replace the filter packs created by several anime fansub groups into a single reliable pack capable of decoding practically any group's files -- without breaking compatibility for other formats."  It was also a response to the other available "mega-codec-packs" that had become commonly used and were notorious for causing all sorts of problems (some of which require a full nuke-and-pave of the system to correct).  The primary design goal was, like the physician's creed, "first, do no harm."  It is, by no means, the only option for playing back your different media types ([[DirectShow_Playback_Guide#Alternative_Source_and_Transform_Filters|read below for some other options]]) but it is a very good, simple, stable option.
  
This is a great multiple-filter pack that provides filters for [http://www.cccp-project.net/wiki/index.php?title=FAQ#Supported_Formats playback of most media formats], including DVD. At the heart of CCCP is [[DirectShow_Playback_Guide:Alternative_Filters#FFDSHOW|FFDSHOW]], which is a general purpose DirectShow filter that can be used to decode a large number of media formats.  CCCP also includes quite a few other major components, including: MPV video decoder (decodes DVD and other MPEG-2 video), and Haali Media Splitter (handles decoding MP4, MKV, M4A, and a number of other container formats).
+
One '''important note''' is that if you want to play back [[Video_Files_with_Multiple_Audio_Streams|AVI files with multiple audio streams]], FFDSHOW takes some additional configuration.
  
This "pack" is probably the single simplest method to get the vast majority of file types to play back properly and reliably.  There are a few file types that CCCP does not support out of the box, including Quicktime, RealMedia, and FLV video (though it tries at FLV)Adding support for these file types is described below, though the [http://www.cccp-project.net/wiki/index.php?title=FAQ#UnSupported_Formats CCCP Project site has much more information on this topic].
+
They have a truly fantastic [http://www.cccp-project.net/wiki/index.php?title=Main_Page#FAQ.27s.2C_guides_and_other_CCCP_documentation set of FAQs on their site] that can help you get it set up, expanded, and working optimallyThere is also a meticulous step-by-step [http://www.cccp-project.net/wiki/index.php?title=Troubleshooting_Guide '''Troubleshooting Guide'''] which can help you solve almost any problem you might encounter with it.
  
 
Make sure [http://www.cccp-project.net/wiki/index.php?title=Main_Page#Latest_CCCP_.28aka._Download_Here.21.29 you read the instructions before installing CCCP]. As a general rule, you should uninstall any previously installed codec packs, as different codec packs often conflict with each other. You should also uninstall previously installed individual filters that CCCP includes, such as [[DirectShow_Playback_Guide:Alternative_Filters#FFDSHOW|FFDSHOW]], Haali Media Splitter. This way you will be sure that CCCP can install and configure the filters properly.
 
Make sure [http://www.cccp-project.net/wiki/index.php?title=Main_Page#Latest_CCCP_.28aka._Download_Here.21.29 you read the instructions before installing CCCP]. As a general rule, you should uninstall any previously installed codec packs, as different codec packs often conflict with each other. You should also uninstall previously installed individual filters that CCCP includes, such as [[DirectShow_Playback_Guide:Alternative_Filters#FFDSHOW|FFDSHOW]], Haali Media Splitter. This way you will be sure that CCCP can install and configure the filters properly.
  
Additionally, when installing CCCP, make sure you uncheck the option to install FLV Splitter. The version of FLV splitter included with CCCP does not work well. [[DirectShow_Playback_Guide#FLV|See "FLV" below]].
+
Additionally, when installing CCCP, '''make sure you uncheck the option to install FLV Splitter'''. The version of FLV splitter included with CCCP does not work well. [[DirectShow_Playback_Guide#FLV|See "FLV" below]].
 +
 
 +
== DVD and MPEG-2 Playback ==
 +
 
 +
:''further information:'' [[DirectShow_Playback_Guide:DVD_and_MPEG-2|DirectShow Playback Guide: DVD and MPEG-2]]
 +
 
 +
For DVD playback, you need DVD capable MPEG-2 video decoder and a MPEG-2 / AC3 audio decoder. These filters may or may not already exist on your computer. Some computers come with filters for DVD; some do not.  Filters may also come with installation of some third-party software.  If you do not already have the needed filters, you may need to install them. Commercial decoders are available from various vendors. Free decoders are available and described below.
 +
 
 +
Again, [[DirectShow_Playback_Guide#CCCP_-_Combined_Community_Codec_Pack|CCCP]] fully supports DVD Playback out of the box.  The simplest free method to enable DVD Playback support is to just use CCCP.  Once installed go into FFDShow Video Decoder configuration which can be found in 'All Programs' from the Windows Start Menu and then in the codecs list find MPEG2 and make sure it's set to libmpeg2 or libavcodec (Experiment with both for the best results. Some machines prefer one or the other). Also tick the DVD decoding box. Failure to do these things will cause DVD Decoding to fail.
 +
 
 +
The only other configuration step typically required is to enable Dolby Digital (AC3) decoding support in FFDSHOW (which is included as part of CCCP).  This process is explained on the [[Dolby AC3]] page.
 +
 
 +
If you'd prefer not to use CCCP, or if you have special needs, there are a wide variety of other Filters available that can handle DVD playback.  Some of these alternative options, if properly configured, can provide absolutely stunning playback quality which meets (and often exceeds) the quality available from the best set-top upscaling DVD Players commercially available.  Check the [[DirectShow_Playback_Guide:DVD_and_MPEG-2|DirectShow Playback Guide: DVD and MPEG-2]] page for further information.
 +
 
 +
== Additional Useful Filters ==
 +
 
 +
As mentioned above, CCCP '''does not''' include each and every filter you could possibly need to have in order to support your media.  The best place to look for more information is on the [http://www.cccp-project.net/wiki/index.php?title=FAQ#UnSupported_Formats CCCP Wiki page describing Unsupported Formats].  However, here are a few of the big ones:
  
== Additional Filters to Expand CCCP ==
+
=== Real Alternative ===
  
As mentioned above, CCCP does not include each and every filter you could possibly need to have in order to support your media.  The best place to look for more information is on the [http://www.cccp-project.net/wiki/index.php?title=FAQ#UnSupported_Formats CCCP Wiki page describing Unsupported Formats].  However, here are a few of the big ones:
+
[http://www.codecguide.com/about_real.htm Real Alternative] is a free, open source implementation of the Real playback engine, which handle Real Media file types without having to install the "real" RealPlayerIt is essentially a set of DirectShow filters that allows DirectShow to natively handle RealMedia files.  '''Please note:''' When installing RealAlternative, you don't need to install MPC again as it's included as part of CCCP.  KL Software (the group that releases the Real and Quicktime Alternative packages) now has a "Lite" edition of both Alternatives that are identical to the full version but it doesn't include Media Player Classic.  It's best to download and use the Lite Edition if you will be using it with CCCP.
  
=== RealAlternative ===
+
=== Apple Quicktime Player ===
  
[http://www.free-codecs.com/download/Real_Alternative.htm RealAlternative] is a free, open source implementation of the Real playback engine, which handle Real Media file types without having to install the "real" RealPlayerIt is essentially a set of DirectShow filters that allows DirectShow to natively handle RealMedia files.  Please note: When installing RealAlternative, you don't need to install MPC again as it's included as part of CCCP (so you can deselect that option during the install).
+
MC uses Quicktime as its "fallback" rendering engine if DirectShow playback fails.  So, it's a good idea to have Quicktime installed even if you don't use any Quicktime Media.  [http://www.apple.com/quicktime/download/ Quicktime Player is available for free from Apple].  You do not need to choose the version that includes iTunes -- there is still a standalone player version availableQuicktime is available free of charge from Apple for a variety of platforms.
  
=== Quicktime ===
+
* Windows Vista, XP SP2: http://www.apple.com/quicktime/download/
 +
* Windows 2000 SP4: http://www.apple.com/support/downloads/quicktime716forwindows.html
 +
* Windows 98, ME, 2000 (pre-SP4), Windows XP (pre-SP2): http://www.apple.com/support/downloads/quicktime652forwindows.html
  
MC uses Quicktime as its "fallback" rendering engine if DirectShow playback failsSo, it's a good idea to have Quicktime installed even if you don't use any Quicktime Media[http://www.apple.com/quicktime/download/ Quicktime Player is available for free from Apple].  You do not need to choose the version that includes iTunes -- there is still a standalone player version available.
+
You can spend a lot of time discussing the relative merits of and problems with Apple's QuickTime engine and player softwareIt is certainly far from perfect, but it does work for a large number of users and is well supportedInstalling the full Apple Quicktime Player is an easy way to extend the file type support of MC, and is required to use any DRM-protected M4P files you may have purchased from the iTunes Store.
  
If you choose to install the "real" Quicktime, make sure to manually de-select all the file type Associations possible during the install so it doesn't take over your media filesYou can also disable the task tray icon under Edit --> Preferences --> Quicktime Preferences --> Advanced tab --> Install QuickTime icon in system tray from inside Quicktime.
+
Installing Quicktime can sometimes create more problems than it solves because of some of the default settings the application uses when you install it.  All of these annoying qualities can be mitigated or eliminated by being very careful as you proceed through the installation process, and by taking a few steps after the installation is complete.  For a detailed guide to installing Quicktime in the least annoying method possible, refer to the [http://www.codecguide.com/quicktime_installation.htm Quicktime Installation Guide at CodecGuide.com].
  
=== QuicktimeAlternative ===
+
=== Quicktime Alternative ===
  
Similar to RealAlternative You can also choose to install [http://www.free-codecs.com/download/QuickTime_Alternative.htm QuicktimeAlternative] instead of the "real" Quicktime.  This will allow Quicktime MOV files to play back via DirectShow.  If you choose the Alternative, same as RealAlternative, you don't need to install MPC, as it's included in CCCP.
+
Similar to RealAlternative, you can also choose to install [http://www.free-codecs.com/download/quicktime_alternative.htm Quicktime Alternative] instead of the "real" Quicktime.  This will allow Quicktime MOV files to play back via DirectShow.  If you choose the Alternative, same as RealAlternative, you don't need to install MPC, as it's included in CCCP so be sure to download and use the Quicktime Alternative "Lite" Edition (which is identical to the full version but it doesn't include MPC).  It is actually a good idea to install at least the Splitter portion of Quicktime Alternative, even if you use the full, Apple version of Quicktime.  This will allow your Quicktime MOV files to play back in regular DirectShow applications.  MC12 can handle Quicktime files as long as either QuicktimeAlternative or the official Apple QuickTime package is installed on the system.
  
It is actually a good idea to install at least the Splitter portion of Quicktime Alternative, even if you use the full, Apple version of Quicktime.  This will allow your Quicktime MOV files to play back in regular DirectShow applicationsMC can handle Quicktime files with, or without, QTAlternative installed.
+
Apparently, Quicktime Alternative may not be updated as regularly anymore (the current status is unclear).  An alternative to the alternative is [http://codecguide.com/qt_lite.htm QTLite].  QTLite differs from Quicktime Alternative in that it doesn't contain MPC or any DirectShow filters.  Therefore, if you use only QTLite, you will also need to be sure that you have appropriate MPEG-4 DirectShow filters installed to handle playbackBoth CCCP and KLCP are equipped to handle this part of the job.
  
 
=== FLV ===
 
=== FLV ===
Line 147: Line 167:
 
Choose "Codecs" from the top of the left panel. On the right panel, find FLV1 in the first column ("Format"), and change the value in the second column ("Decoder") from "disabled" to "libavcodec". Click OK.
 
Choose "Codecs" from the top of the left panel. On the right panel, find FLV1 in the first column ("Format"), and change the value in the second column ("Decoder") from "disabled" to "libavcodec". Click OK.
  
[http://esby.free.fr/CelticDruid/mirror/Media%20Player%20Classic/external%20filters/unicode/FLVSplitter.7z FLV Splitter]
+
'''To install the FLV Splitter:'''
  
To install the FLV Splitter: [[DirectShow_Playback_Guide#4._How_do_I_install_DirectShow_filters.3F|Download and unzip it. Then Register it.]]
+
First, you need to download the file.  You can get it from [http://sourceforge.net/projects/guliverkli2/files/DirectShow%20Filters/FLV%20Splitter%201.0.0.5/FLVSplitter_20090428.zip/download Source Forge here].  Simply click on ''external filters (unicode)'' underneath Media Player Classic in the left-hand navigation bar, and then choose ''FLVSplitter.7z'' from the list of files that comes up.  Then [[DirectShow_Playback_Guide#4._How_do_I_install_DirectShow_filters.3F|unzip and Register it using these instructions]].
  
 
Note: The latest CCCP also includes a version of FLVsplitter that does not work with Google/YouTube videos. You should use the version linked here (built by Celtic Druid), which, in addition to being able to play FLV1 videos from Google/YouTube when used with FFDShow, also includes an FLV Video Decoder filter which decodes FLV4 format (FFDShow decodes FLV1).
 
Note: The latest CCCP also includes a version of FLVsplitter that does not work with Google/YouTube videos. You should use the version linked here (built by Celtic Druid), which, in addition to being able to play FLV1 videos from Google/YouTube when used with FFDShow, also includes an FLV Video Decoder filter which decodes FLV4 format (FFDShow decodes FLV1).
  
== Alternative MPEG-4 and Other Filters ==
+
== Alternative Source and Transform Filters ==
  
While CCCP is the easiest way to get your system working, there are alternatives of course.  [[DirectShow_Playback_Guide:Alternative_Filters|Click here for documentation on some of the important and useful alternatives]], as well as more information on many of the components used in CCCP.
+
:''further information:'' [[DirectShow_Playback_Guide:Alternative_Filters|DirectShow Playback Guide: Alternative Filters]]
  
Some of these alternatives include: FFDSHOW (standalone), DivX and XviD, CoreAVC, and some hardware accelerated filters.
+
While CCCP is the easiest way to get your system working, there are alternatives of course.  For more information on many of the available alternatives, please read the [[DirectShow_Playback_Guide:Alternative_Filters|DirectShow Playback Guide:Alternative Filters]] page.
  
== DVD and MPEG-2 ==
+
Some of these alternatives include: FFDSHOW (standalone), DivX and XviD, CoreAVC, and some hardware accelerated filters.  There is also information included on filters required to handle new and modern File Container formats such as MP4, M4A, MKV, and OGM.  Many of the components listed are the same ones included as part of the CCCP set.  These are all available separately though and can be mix-and-matched on your own for advanced purposes.
  
For DVD playback, you need DVD capable MPEG-2 video decoder and MPEG-2 / AC3 audio decoder. These filters may or may not already exist on your computer. Some computers come with filters for DVD; some do not.  Filters may also come with installation of some third-party software.  If you do not already have the needed filters, you may need to install them. Commercial decoders are available from various vendors. Free decoders are available and described below.
+
== Additional Useful DirectShow Tools ==
  
Again, [[DirectShow_Playback_Guide#CCCP_-_Combined_Community_Codec_Pack|CCCP]] fully supports DVD Playback out of the box.  The simplest free method to enable DVD Playback support is to just use CCCP.
+
There are a number of other tools that, while not actually DirectShow Filters, are extremely useful to have installed on your system to help in diagnosing any issues you may have and for altering DirectShow related settings and configurations.
  
Alternatively you can try these filters:
+
* [http://www.headbands.com/gspot/ G-Spot Codec Information Appliance]: GSpot is a free utility which identifies specific media streams inside the container file and supplies other information as well.  If you get no other extra tools, this is the one you want.
 +
* [http://www.free-codecs.com/download/RadLight_Filter_Manager.htm RadLight Filter Manager]: Allows you to change merit of DirectShow filters and it can also be used to list all registered codecs and to register or unregister codecs.
 +
* [http://www.softella.com/dsfm/index.en.htm DirectShow Filter Manager]: Very similar to RadLight Filter Manager.
 +
* [http://www.divx-digest.com/software/avifourcc.html FourCC Changer]: Read the FourCC code from any given AVI file and allow you to set anything in it's place.
 +
* [http://en.wikipedia.org/wiki/Graphedit Microsoft GraphEdit]: GraphEdit is a visual tool for building and testing filter graphs.
 +
* [http://www.divx-digest.com/software/avifix.html AVI Fixed]: Rebuilds the headers of broken or partial AVI files.
 +
* [http://www.free-codecs.com/download/VobSubStrip.htm VobSubStrip]: Can selectively remove individual subtitle streams from AVI files.
  
=== Video decoders: ===
+
= Advanced DirectShow Configuration in MC12 and later =
  
[http://sourceforge.net/project/showfiles.php?group_id=7420&package_id=123423 DScaler 5]. This is still in alpha. Therefore expect to have some problems with it. I have had only one problem though. It is related to DVD menus. I experience menu problem only with one of several DVD movies I played.
+
As mentioned previously, [http://www.jriver.com/ J. River MEDIA CENTER] includes a number of new features which greatly expand your ability to customize the behavior of the DirectShow filters used to render your media files. Most of these new features can be found in the DirectShow Playback Options dialog. This dialog can be found by going to: ''Tools --> Options --> Playback --> Video--> DirectShow Playback Settings. NOTE -- this moved to Options --> File Types in MC13.''
  
Generally DScaler can be used for vastly improved deinterlacing and resizing support, and it's quality is "considered" the best. It can be difficult to get it set up properly.
+
[[Image:Mc12 directshow options-closeup.jpg|thumb|none|550px|The new DirectShow dialog box in MC12.]]
  
[http://sourceforge.net/project/showfiles.php?group_id=82303&package_id=170669 Gabest Universal Open Source MPEG Video Decoder]
+
== DirectShow Playback Options ==
  
Older versions of FFDShow video decoder do not work well with DVD (even though it has user interface to turn on DVD decoding capability). Newer versions maybe able to decode DVD properlyHowever, because there are still some (relatively minor) issues with DVD decode support in FFDSHOW, CCCP still uses the Gabest Decoders instead, which work quite reliably.
+
On the right hand side of the dialog is the DirectShow filters list.  The primary purpose of this list is to allow you to enable and disable DirectShow support based on what type of file it is. If the box next to the given file type is checked, MC will attempt to decode any files you play of that type via DirectShowConversely, if the box is unchecked, then MC will try to render the file via other means (often via Quicktime).
  
=== Audio decoders: ===
+
<blockquote>
 +
Note: I am not clear on what happens here.  I know that MC will "fall back" and use Quicktime in many circumstances, but is there anything else that it tries (like the WMP Engine for example)?  What happens if you uncheck a box that isn't supported by Quicktime -- does the file just fail to play then?</blockquote>
  
FFDShow Audio decoder works well with DVD.
+
=== Video Playback Options ===
  
DScaler 5 (DScaler 5 includes both an audio decoder and a video decoder).
+
On the left side the dialog gives you a range of global options over how the video and audio will be rendered.  These options are not File Type specific, but universal to all DirectShow types.  Note that the [[DirectShow_Playback_Guide#Filter_Configuration_During_Playback|Video Controls]] only work while you have a file actively playing back. The other controls here include:
  
[http://ac3filter.net/ AC3Filter] is another good option for decoding AC3 and DTS tracks.
+
* [[Use Windows Media Player engine]] for video playback when possible:  This tells MC to try to use the rendering engine from Microsoft's Windows Media Player to render the file.  This engine has advantages and disadvantages, but it can be useful especially for DRMed Video Media.
 +
* [[Aspect Ratio]]:  These controls let you override the video file's source [http://en.wikipedia.org/wiki/Display_Aspect_Ratio display aspect ratio] to correct video files that were encoded improperly or where the player doesn't correctly determine the proper aspect ratio.
 +
* [[Audio Renderer]]: Lets you choose from the different available Audio Renderer filters available on the system on a per-zone basis.
 +
* [[Crop Edges]]: zooms the image slightly to compensate for the non-overscanned computer display.
 +
* [[Use WMV Acceleration]]: enables/disables hardware WMV Acceleration (I think -- is it hardware or some software optimization?)
  
[[http://wiki.jrmediacenter.com/index.php/DTS_WAV Be sure to read this FAQ]] if you are interested in full support for [http://en.wikipedia.org/wiki/Digital_Theater_System DTS WAV] playback.
+
You can also tag individual Video files with specific settings for many of these controls see [[Customisable Video Playback]]
  
=== Hardware Accelerated Decoders ===
+
=== DirectShow Filters ===
  
Both the [[DirectShow_Playback_Guide#AMD.2FATI_Avivo_H.264|AMD AVIVO technology]] and the [[DirectShow_Playback_Guide#nVidia_PureVideo|Nvidia PureVideo technology]] mentioned below include MPEG-2 decoding support in addition to MPEG-4 support.  Both decoders are very high quality and extremely fast, though with modern computer processors the necessity of offloading the relatively simple task of MPEG-2 decoding to the video card is of limited benefit.
+
[[Image:Mc12 directshow ChooseFilters.jpg|thumb|right|400px|Customize DirectShow playback filter for individual file types in MC12.]]
  
AMD's AVIVO decoder in particular has been [http://www.anandtech.com/showdoc.aspx?i=2645&p=1 rated among the highest quality decoders available in independent quality comparisons].  AMD's MPEG-2 decoder (developed in partnership with Cyberlink) is available free of charge with many of their video cards (updates are available at [http://ati.amd.com/ AMD's web site])Nvidia's PureVideo product is available for a [http://www.nvidia.com/object/dvd_decoder.html small fee from their PureVideo site].
+
Perhaps more importantly, if you ''select one of the file types from the list'' and then hit the ''Select Filters'' button, it opens a new dialog where you can configure the specific filters that you'd like MC to try to use to render whenever it plays that particular file typeThis dialog is pictured on the right.
  
Many other third party commercial applications include codecs that support the MPEG-2 hardware acceleration features of both nVidia and ATI/AMD video cards, including: [http://www.nero.com/nerodigital/enu/index.html Nero Digital], [http://www.cyberlink.com/ Cyberlink PowerDVD], and [http://www.intervideo.com/jsp/Home.jsp InterVideo WinDVD].
+
In this dialog, you can choose a ''Source Filter'' (maximum one), and one or more ''Other Filters'' (which are mostly just Transform decoding filters). You may choose more than one ''Other Filter'' and MC will try to render a graph using all of them. While I am not clear on the exact mechanism used to do this internally, MC essentially overrides the Merit score on the filters you choose here when a specific file type is played back. This is far more powerful than is available via modifying the Merit Scores for filters directly, because a particular filter only gets one Merit score, but may be able to handle many different file and codec types.
  
== Alternative Container File Source Filters ==
+
Please bear in mind, this dialog does not force DirectShow to use '''only''' the filters you have selected and no others.  This dialog is more of a way to force DirectShow to try your particular set of filters to render the file first.  As usual, if that filter combination fails (the input pins can't connect to the output pins in the graph), then DirectShow will take over and build the default graph and try to play the files.  You also do not need to select both a Source and an Other filter.  If you select only one component (or no components) then DirectShow will also build the default graph and render the file, but it will try to use any filters you selected first (though often these filters go together in "sets" so it may be more effective to do so).
  
While many video files are still wrapped in AVI containers (which can be split by built-in Microsoft provided filters), there are a few new and emerging container formats which are becoming more and more common. Again, CCCP handles the following formats on it's own, but here is some information on the individual components.
+
In this same dialog, you can choose which Video Renderer to use to try to play back the file.  Three choices will be available on all systems: [http://en.wikipedia.org/wiki/VMR9#Video_rendering_filters VMR9, VMR7, and Legacy Video Renderer (Overlay)]. Users of Windows Vista, or Windows XP with .NET 3+ installed, will also be able to choose the [http://en.wikipedia.org/wiki/VMR9#Video_rendering_filters Enhanced Video Renderer (EVR)].  Finally, users with [http://haali.cs.msu.ru/mkv/ Haali Media Splitter] installed will also be able to choose the Haali Video Renderer.
  
=== MPEG-4 Container Family (mp4 / m4a / m4v) ===
+
Again, all of these options will be applied only to the specific media type that you had previously selected when you hit the ''Select Filters'' button in the DirectShow Playback Options dialog box.
  
In order to play these types of files in DirectShow engine, you will need not only decoder filters but also splitter filters.  Generally FFDSHOW would be the best decoder filter for most MPEG-4 video stream types, but you do need a separate application to "split" the MP4 container format to feed FFDSHOW the stream data.
+
== Filter Configuration During Playback ==
  
Splitters:
+
You can also configure and work with these filters actively while the files are playing back. Simply right click in the video window inside Playing Now (or Display View) and choose ''DirectShow Filters''.  This presents you with a pop-out menu which lists each of the filters being used in the current graph, in order (with the Source Filters on the bottom and the Render Filters on the top of the stack).
  
You can use [http://haali.cs.msu.ru/mkv/ Haali Splitter] (which is used in CCCP), or [http://prdownloads.sourceforge.net/guliverkli/mp4splitter_20060304.7z MP4 splitter].
+
[[Image:Mc12 directshow PlayingFilters.jpg|thumb|none|550px|Filter adjustment during playback. Inside lies a video tweaker's paradise.]]
  
[http://www.3ivx.com/download/index.html 3ivx] has a filter pack that includes all filters (splitter and decoders) needed for mp4 type. It is however not free.
+
From here you can select any of the presented filters and MC will launch that filter's UI. These UI's often display an informational dialog (showing frames played and stream information), but with many filters you can also make an array of adjustments to the media stream as it is being sent to the renderer (such as in FFDSHOW). Many of these adjustments work "live" (meaning that they are applied on the fly while the video is playing back. You can also choose ''Select Filters'' and configure the filters that will be used for this file type (you may have to stop and re-start playback for these changes to take effect).
  
=== Matroska Family (MKV/MKA) ===
+
From within the right-click menu while you are playing a video back you also have the Video Playback Settings choice.  This will actually open up the ''DirectShow Playback Options'' dialog discussed at the beginning of this section.  However, now the Video Controls will be enabled and can be used to adjust the chroma and luma controls on the fly while the video plays back.
  
[http://www.matroska.org/ Matroska] is a modern, extensible open standard A/V container.  Matroska is typically found as .MKV files (matroska video) or .MKA files (matroska audio).  CCCP is the official codec set for Matroska files, and it is the recommended way to handle these file types.
+
= See Also =
  
There are other options of course, [http://haali.cs.msu.ru/mkv/ Haali Splitter] will handle decoding MKV files on it's own.
+
* [[DirectShow_Playback_Guide:Alternative_Filters|DirectShow Playback Guide:Alternative Filters]]
 +
* [[DirectShow_Playback_Guide:DVD_and_MPEG-2|DirectShow Playback Guide: DVD and MPEG-2]]
 +
* [[DTS_WAV|DTS_WAV Playback Support]]
 +
* [[Audio_Formats|Audio Formats]]
 +
* [[Video_Formats|Video Formats]]
  
 
= External Links =
 
= External Links =
  
[http://www.doom9.org/ Doom9.org]: video backup and conversion info
+
* [http://www.doom9.org/ Doom9.org]: video backup and conversion info
 
+
* [http://forum.doom9.org/ Doom9 Forums]: almost more important than the main Doom9 Web Site
[http://forum.doom9.org/ Doom9 Forums]: almost more important than the main Doom9 Web Site
+
* [http://www.avsforum.com/ Audio/Video Science Forums]
 
+
* [http://www.hydrogenaudio.org/forums/index.php Hydrogenaudio Forums]: audio enthusiast web site
[http://www.avsforum.com/ Audio/Video Science Forums]
 
 
 
[http://www.hydrogenaudio.org/forums/index.php Hydrogenaudio Forums]: audio enthusiast web site
 
 
 
  
[[Category:Frequently Asked Questions]]
+
[[Category:Archived FAQs]]

Latest revision as of 10:30, 18 April 2015

IMPORTANT NOTE: MC16 introduced Red October, a simple and reliable way of using DirectShow filters. Select Red October Standard under video options. The following is needed mainly for earlier versions of MC.

Native DirectShow filter support was added to MC11.1 in December 2005 and has been improved dramatically with MC12. DirectShow is a multimedia API released by Microsoft which became a standard component of Windows with Windows 98. It is essentially a replacement for the earlier Video for Windows technology. In Windows Vista this technology has evolved into the Windows Media Foundation, which performs similar services. It provides developers with a unified interface across different programming languages to allow their applications to render or record media files, using a filter based framework.

MC12 has greatly expanded DirectShow playback configuration options and support.

What is DirectShow? What is a DirectShow filter?

Media Center plays many media formats in DirectShow, including DVD and many video and audio files. DirectShow is a Microsoft technology for playing (and recording) audio/video media on a Windows computer.

DirectShow uses the concept of “Filter Graph” to take a multimedia file on disk and turn it into what you see or hear from your computer. A filter graph is like a chain of individual “DirectShow Filters”. A filter is a software component in DirectShow that will work with other similar components to render a media file. They are sort of like little "plugins" for DirectShow that allow it to handle different types of media, different types of files, or perform transformations on the media data. Each filter in the Filter Graph chain processes audio/video data in a specific way to facilitate the playing of the media files. Filters have “pins” - points of connection between filters, both input pins and output pins. Pins are the means by which media data is passed from one filter to another filter. For example, the Input pin of the Haali Media Splitter will receive the data from the file, split it to it's component parts and then output those "streams" via it's output pins. FFDSHOW will then connect it's input pins to Haali's output pins and decode the video stream.

You can use the free GraphEdit utility from Microsoft to manually build filter graphs if you want to play around with how this works.

GraphEdit with a x264 compressed MKV file loaded, showing the default filter graph.
The pins are the connections between the different filter boxes, with outputs on one end and inputs on the other.

Filter Types

further information: DirectShow Playback Guide: Filter Types

Generally speaking, there are three types of filters in terms of functionality: Source filters, Transform filters, and Render filters.

Before explaining what these different types of filters do, it is useful to understand a bit more about how multimedia content is stored in files on disk. With most media files, there is a distinction between the file container format and the individual media stream types (sometimes referred to as the codec or the FourCC of the file) "contained" inside the file. The container format is essentially the file you see on your hard drive (the AVI, MKV, MP4, OGM, or whatever) which is used to identify and interleave the different media stream types. It is the individual media streams inside the container which make up the actual media, including metadata tags, video streams, audio streams, subtitles, and other information. So, wrapped up inside the AVI or MP4 file there will be one or more different types of media, usually compressed with a codec of some type. A codec is a special type of filter (or other similar software) that can both encode a media stream to a compressed format, and decode a stream from that same compressed format -- a COmpressor/DECompressor, which is how it gets its name.

GraphEdit with the filters labeled.

To play back a file properly via DirectShow you always need at least one Source Filter and one Render filter. Usually, however, you need one Source Filter, one or more Transform filters, and one or more Render Filters. The Source Filter (often referred to as the Splitter Filter) reads the file container format and splits out the different "streams" of data contained within. This data is usually then passed over to a set of Transform filters which decode the different media streams (including audio, video, and metadata, such as subtitles). These Transform filters are often (somewhat erroneously) called Decoder Filters, or Codecs (which stands for enCODer/DECoder), because they often take care of decompressing the media. Because uncompressed video footage is incredibly huge, compression is almost always used to keep file sizes lower. Generally you'll need one decoder filter to process each "stream type" that comes out of the Source Filter (though many, like FFDSHOW, handle more than one type of stream). They then pass the raw decoded data to the Render filters which transforms the uncompressed raw data into what you see on screen and hear through your sound device.

Sometimes these lines blur, when a particular filter can act as both a splitter and a decoder filter (such as FFDSHOW), or Haali which also processes and decodes some of the data streams (subtitles for example). Also, when you play back uncompresed media (such as an uncompressed audio track) you do not always have a transform filter and the source pin connects directly to the render filter.

How DirectShow Decides Which Filters to Use

MC supports a number of audio file types natively. When you play back a MP3 file, for example, MC uses it's own internal high-quality filters to split and decode the file and send it to the appropriate output device (sound card). When you attempt to play a file back in MC that it doesn't support natively, MC tries a number of different things to get the file to play. The first step is to attempt to render the file using DirectShow.

By default, if you haven't modified the DirectShow playback configuration options in MC, and you play a file back, it simply asks Windows to build the regular DirectShow graph. This works the same as Windows Media Player and any other DirectShow player does when playing back a file.

Illustration of how Filters get selected. In the example, even though all of the filters support MP4 playback, DirectShow will use the Haali filter because it has the highest Merit Score.

The default graph is built based on two factors: a) each individual filter "tells" DirectShow what kinds of media streams it is able to render, and b) DirectShow assigns (or more precisely, the filters assign to themselves when you install them) a priority number called its "merit score".

When you play a file, DirectShow attempts to build a chain of filters capable of decoding the content based on these two pieces of information. It tries filters matching the stream type, in the order of which filter has the highest priority first. If the "render" fails, then it tries the next highest priority set, and so on and so forth until it runs out of options or succeeds. Just because it "works" doesn't mean it's necessarily finding the "best" filter graph. It just uses whichever one it "bumbles" into that works first.

MC's DirectShow Playback settings dialog overrides the priority part of this sequence of events. If you select one or more of those filters, it overrides the normal merit score system (perhaps by temporarily elevating them to the highest possible Merit -- I'm not sure of the details of this mechanism). So, you can force it to "try" to use a different filter to play a file back, but you can't force it to use one or fail outright. If that graph fails (the output pins can't connect to the input pins to build a complete render graph) then it either ignores certain selected filters, or it fails over completely to the default graph. (MC's DirectShow Playback Settings dialog provides essentially identical functionality to ZoomPlayer's "Smart Play" feature.)

I've simplified this a bit for the sake of explanation, but that's the general idea of what happens when you try to play a file back via DirectShow.

What version of DirectX do I need?

In order to play media using DirectShow, you must have Microsoft DirectX installed. We recommend DirectX 9.0c to take advantage of features that are available only in late versions. While technically DirectShow itself was removed from the larger DirectX package in April 2005 (and moved to the Microsoft Platform SDK instead), MC still makes use of many DirectX features and it is still critical to ensure that you have installed the most current version of DirectX on your system.

DirectX 9.0c is included as part of the Windows XP Service Pack 2 update, so if you are running Windows XP SP2 it is likely that version is already installed on your computer, and you do not need to do anything in most cases. For earlier versions of Windows operating system, we recommend you download it from Microsoft website and install it.

Windows Vista ships with DirectX 10, which Microsoft says will not be made available for older versions of Windows. DirectX 10 has been completely overhauled from earlier versions. Like all versions of DirectX, it is completely backwards compatible with older versions of DirectX. If you are running Windows Vista, DirectX 10 is what you want to have!

To check which version of DirectX is installed on your computer using the dxdiag tool, please refer to Microsoft KB Article 157730.

Why do I need to get DirectShow filters?

In short, you don't need to, but you'll probably want to! The entire purpose of DirectShow is to allow the system to easily expand to support new media types through the "plug-in" Filter architecture.

In order to play media files in DirectShow, one must have DirectShow filters that can handle the media types to be played. DirectShow comes with some of the filters that are needed, for example video and audio renderers and MPEG-1 filters. DirectShow, however, does not include all filters that are needed to handle common (and more modern) media types. So, you must make sure you have appropriate filters for the file types you want to play. DirectShow filters come from a variety of sources. We do not, and can not, include all filters that are needed in Media Center‘s installation. In most cases you will need to install decoder filters from other sources. For example in order to play DVD on your computer you must have DVD capable MPEG-2 video decoder, and audio decoder(s) that are capable of decoding MPEG-2 audio and/or AC3 audio formats.

Another important example is M4A audio files. M4A files are simply MP4 files that contain only an audio stream (usually AAC encoded). In order to play these files back you need to either have Quicktime Player installed, or you need to install the proper DirectShow filters and enable DirectShow M4A support. Generally, DirectShow playback will give better results for M4A files, but because most people have Quicktime installed already, MC disables DirectShow support in favor of Quicktime by default.

Some computers do come with certain filters installed by the computer vendor. However, the filters preinstalled may not be top-notch filters. In such case it is to your advantage to find and install better filters..

How do I install DirectShow filters?

It depends on the filter. Some filters come with an installation program. You just need to execute the program, and the installation wizard will guide you through the process. Most filter packs are installed this way, via the standard "setup.exe" Windows software installation motif. Then, to remove them, you just go the the standard Add/Remove Programs Control Panel and proceed normally.

Unfortunately, not all filters come with an installation wizard. Instead they are just one or more files with file extension .ax or .dll, often contained in an archival file (ZIP or RAR). In such a case, you first need to extract the file(s) into a folder where you'll be able to find them using a program like ZipGenius or WinZip. Any folder is fine, really, but I like to use C:\Program Files\DirectShow_Filters\ (because it's then easy to find the filters later if I need to uninstall or update them).

Once you've extracted the filter files to an appropriate folder, you then need to register the filter using the Windows program Regsvr32.exe. This program exists on every Windows computer in your System32 directory (inside the Windows folder). To do this, simply call the regsvr32.exe program and give it the path to your new filter as its command line argument.

For example, if you downloaded a filter whose file name is NewFilter.ax, and you placed the file in "€œC:\Program Files\DirectShow_Filters\"€œ, you can register it by going to the Start button and choosing "€œRun"€. Then enter the following line (including quotes) in the box that appears:

regsvr32.exe "C:\Program Files\DirectShow_Filters\newfilter.ax"

When you click OK a dialog box should pop up saying "DLLRegisterServer in C:\Program Files\DirectShow_Filters\newfilter.ax succeeded", indicating that the filter is now registered with the system. That's it! You've now successfully installed the filter.

Successfully registered FLVSplitter.ax to enable FLV Video playback in MC!

NOTE 1: Some filters may come with two versions of them, a Unicode version and a non-Unicode verion. You should register the Unicode version as Media Center supports Unicode.

If you ever decide you don't need a particular filter anymore, you can also unregister a filter in much the same manner, by using the command line parameter /U. For example to unregister the filter registered in the above example, you issue this command:

regsvr32.exe /U "C:\Program Files\DirectShow_Filters\newfilter.ax"

In this case you will get a confirmation saying “DllUnRegisterServer in C:\Program Files\DirectShow Filters\newfilter.ax succeeded.” You are then free to delete the filter file(s) from your system.

NOTE 2: On Windows Vista and higher, registration/unregistration of filters is done slightly differently. Instead of choosing "€œRun", you go to Start > All Programs > Accessories, and right-click "Command Prompt" and choose "Run as administrator". When the command prompt opens, type the following command

regsvr32.exe "C:\Program Files\DirectShow_Filters\newfilter.ax"

and press enter. You will get the same confirmation as described above.

What filters do I need and where do I get them?

The answer depends on what media format you want to play. In general you will need decoder filters and, in many cases, you will also need splitter filters. You can obtain commercial filters from various vendors. You can also get free, open source, filters. In this guide we will tell you about some free filters.

Before getting to individual media formats, it is a good idea to introduce/recommend CCCP, a multi-filter and multi-format decoder package. If all you want is for your video and audio files to work reliably, with a minimum of effort (and no money), then CCCP is probably the way to go.

CCCP - Combined Community Codec Pack

CCCP's Configuration Utility (first page).

The Combined Community Codec Pack (CCCP) is a great multiple-filter pack that provides filters for playback of most media formats, including full DVD playback support out-of-the-box. At the heart of CCCP is FFDSHOW, which is a general purpose DirectShow filter that can be used to decode a large number of media formats. CCCP also includes quite a few other major components, including: MPV video decoder (decodes DVD and other MPEG-2 video), and Haali Media Splitter (handles decoding MP4, MKV, M4A, and a number of other container formats). CCCP uses custom settings for and custom versions of many of the individual codecs and filters which make up the pack, so installing CCCP is a better solution than installing the components separately.

This "pack" is probably the simplest method to get most file types to play back reliably. There are a few file types that CCCP does not support out of the box. These include Quicktime, RealMedia, and FLV video (though it tries at FLV). Adding support for these file types is described below, though the CCCP Project site has much more information on this topic. As described on their wiki, the CCCP was created "to replace the filter packs created by several anime fansub groups into a single reliable pack capable of decoding practically any group's files -- without breaking compatibility for other formats." It was also a response to the other available "mega-codec-packs" that had become commonly used and were notorious for causing all sorts of problems (some of which require a full nuke-and-pave of the system to correct). The primary design goal was, like the physician's creed, "first, do no harm." It is, by no means, the only option for playing back your different media types (read below for some other options) but it is a very good, simple, stable option.

One important note is that if you want to play back AVI files with multiple audio streams, FFDSHOW takes some additional configuration.

They have a truly fantastic set of FAQs on their site that can help you get it set up, expanded, and working optimally. There is also a meticulous step-by-step Troubleshooting Guide which can help you solve almost any problem you might encounter with it.

Make sure you read the instructions before installing CCCP. As a general rule, you should uninstall any previously installed codec packs, as different codec packs often conflict with each other. You should also uninstall previously installed individual filters that CCCP includes, such as FFDSHOW, Haali Media Splitter. This way you will be sure that CCCP can install and configure the filters properly.

Additionally, when installing CCCP, make sure you uncheck the option to install FLV Splitter. The version of FLV splitter included with CCCP does not work well. See "FLV" below.

DVD and MPEG-2 Playback

further information: DirectShow Playback Guide: DVD and MPEG-2

For DVD playback, you need DVD capable MPEG-2 video decoder and a MPEG-2 / AC3 audio decoder. These filters may or may not already exist on your computer. Some computers come with filters for DVD; some do not. Filters may also come with installation of some third-party software. If you do not already have the needed filters, you may need to install them. Commercial decoders are available from various vendors. Free decoders are available and described below.

Again, CCCP fully supports DVD Playback out of the box. The simplest free method to enable DVD Playback support is to just use CCCP. Once installed go into FFDShow Video Decoder configuration which can be found in 'All Programs' from the Windows Start Menu and then in the codecs list find MPEG2 and make sure it's set to libmpeg2 or libavcodec (Experiment with both for the best results. Some machines prefer one or the other). Also tick the DVD decoding box. Failure to do these things will cause DVD Decoding to fail.

The only other configuration step typically required is to enable Dolby Digital (AC3) decoding support in FFDSHOW (which is included as part of CCCP). This process is explained on the Dolby AC3 page.

If you'd prefer not to use CCCP, or if you have special needs, there are a wide variety of other Filters available that can handle DVD playback. Some of these alternative options, if properly configured, can provide absolutely stunning playback quality which meets (and often exceeds) the quality available from the best set-top upscaling DVD Players commercially available. Check the DirectShow Playback Guide: DVD and MPEG-2 page for further information.

Additional Useful Filters

As mentioned above, CCCP does not include each and every filter you could possibly need to have in order to support your media. The best place to look for more information is on the CCCP Wiki page describing Unsupported Formats. However, here are a few of the big ones:

Real Alternative

Real Alternative is a free, open source implementation of the Real playback engine, which handle Real Media file types without having to install the "real" RealPlayer. It is essentially a set of DirectShow filters that allows DirectShow to natively handle RealMedia files. Please note: When installing RealAlternative, you don't need to install MPC again as it's included as part of CCCP. KL Software (the group that releases the Real and Quicktime Alternative packages) now has a "Lite" edition of both Alternatives that are identical to the full version but it doesn't include Media Player Classic. It's best to download and use the Lite Edition if you will be using it with CCCP.

Apple Quicktime Player

MC uses Quicktime as its "fallback" rendering engine if DirectShow playback fails. So, it's a good idea to have Quicktime installed even if you don't use any Quicktime Media. Quicktime Player is available for free from Apple. You do not need to choose the version that includes iTunes -- there is still a standalone player version available. Quicktime is available free of charge from Apple for a variety of platforms.

You can spend a lot of time discussing the relative merits of and problems with Apple's QuickTime engine and player software. It is certainly far from perfect, but it does work for a large number of users and is well supported. Installing the full Apple Quicktime Player is an easy way to extend the file type support of MC, and is required to use any DRM-protected M4P files you may have purchased from the iTunes Store.

Installing Quicktime can sometimes create more problems than it solves because of some of the default settings the application uses when you install it. All of these annoying qualities can be mitigated or eliminated by being very careful as you proceed through the installation process, and by taking a few steps after the installation is complete. For a detailed guide to installing Quicktime in the least annoying method possible, refer to the Quicktime Installation Guide at CodecGuide.com.

Quicktime Alternative

Similar to RealAlternative, you can also choose to install Quicktime Alternative instead of the "real" Quicktime. This will allow Quicktime MOV files to play back via DirectShow. If you choose the Alternative, same as RealAlternative, you don't need to install MPC, as it's included in CCCP so be sure to download and use the Quicktime Alternative "Lite" Edition (which is identical to the full version but it doesn't include MPC). It is actually a good idea to install at least the Splitter portion of Quicktime Alternative, even if you use the full, Apple version of Quicktime. This will allow your Quicktime MOV files to play back in regular DirectShow applications. MC12 can handle Quicktime files as long as either QuicktimeAlternative or the official Apple QuickTime package is installed on the system.

Apparently, Quicktime Alternative may not be updated as regularly anymore (the current status is unclear). An alternative to the alternative is QTLite. QTLite differs from Quicktime Alternative in that it doesn't contain MPC or any DirectShow filters. Therefore, if you use only QTLite, you will also need to be sure that you have appropriate MPEG-4 DirectShow filters installed to handle playback. Both CCCP and KLCP are equipped to handle this part of the job.

FLV

FLV, flash video, is a format widely used for streaming. For example Google video and YouTube use this format. This format should play correctly in Media Center without user actions. However, if you do have problem playing them, you need to make sure the following filters are properly installed and configured.

To decode the Flash Video Codec: FFDSHOW

You need to configure it so it will decode FLV video. Media Center should configure it for you automatically, but here is how you can do it manually:

Start -> All Programs -> FFDShow (or Combined Community Codec Pack) -> FFDShow Video Decoder Configuration. Choose "Codecs" from the top of the left panel. On the right panel, find FLV1 in the first column ("Format"), and change the value in the second column ("Decoder") from "disabled" to "libavcodec". Click OK.

To install the FLV Splitter:

First, you need to download the file. You can get it from Source Forge here. Simply click on external filters (unicode) underneath Media Player Classic in the left-hand navigation bar, and then choose FLVSplitter.7z from the list of files that comes up. Then unzip and Register it using these instructions.

Note: The latest CCCP also includes a version of FLVsplitter that does not work with Google/YouTube videos. You should use the version linked here (built by Celtic Druid), which, in addition to being able to play FLV1 videos from Google/YouTube when used with FFDShow, also includes an FLV Video Decoder filter which decodes FLV4 format (FFDShow decodes FLV1).

Alternative Source and Transform Filters

further information: DirectShow Playback Guide: Alternative Filters

While CCCP is the easiest way to get your system working, there are alternatives of course. For more information on many of the available alternatives, please read the DirectShow Playback Guide:Alternative Filters page.

Some of these alternatives include: FFDSHOW (standalone), DivX and XviD, CoreAVC, and some hardware accelerated filters. There is also information included on filters required to handle new and modern File Container formats such as MP4, M4A, MKV, and OGM. Many of the components listed are the same ones included as part of the CCCP set. These are all available separately though and can be mix-and-matched on your own for advanced purposes.

Additional Useful DirectShow Tools

There are a number of other tools that, while not actually DirectShow Filters, are extremely useful to have installed on your system to help in diagnosing any issues you may have and for altering DirectShow related settings and configurations.

  • G-Spot Codec Information Appliance: GSpot is a free utility which identifies specific media streams inside the container file and supplies other information as well. If you get no other extra tools, this is the one you want.
  • RadLight Filter Manager: Allows you to change merit of DirectShow filters and it can also be used to list all registered codecs and to register or unregister codecs.
  • DirectShow Filter Manager: Very similar to RadLight Filter Manager.
  • FourCC Changer: Read the FourCC code from any given AVI file and allow you to set anything in it's place.
  • Microsoft GraphEdit: GraphEdit is a visual tool for building and testing filter graphs.
  • AVI Fixed: Rebuilds the headers of broken or partial AVI files.
  • VobSubStrip: Can selectively remove individual subtitle streams from AVI files.

Advanced DirectShow Configuration in MC12 and later

As mentioned previously, J. River MEDIA CENTER includes a number of new features which greatly expand your ability to customize the behavior of the DirectShow filters used to render your media files. Most of these new features can be found in the DirectShow Playback Options dialog. This dialog can be found by going to: Tools --> Options --> Playback --> Video--> DirectShow Playback Settings. NOTE -- this moved to Options --> File Types in MC13.

The new DirectShow dialog box in MC12.

DirectShow Playback Options

On the right hand side of the dialog is the DirectShow filters list. The primary purpose of this list is to allow you to enable and disable DirectShow support based on what type of file it is. If the box next to the given file type is checked, MC will attempt to decode any files you play of that type via DirectShow. Conversely, if the box is unchecked, then MC will try to render the file via other means (often via Quicktime).

Note: I am not clear on what happens here. I know that MC will "fall back" and use Quicktime in many circumstances, but is there anything else that it tries (like the WMP Engine for example)? What happens if you uncheck a box that isn't supported by Quicktime -- does the file just fail to play then?

Video Playback Options

On the left side the dialog gives you a range of global options over how the video and audio will be rendered. These options are not File Type specific, but universal to all DirectShow types. Note that the Video Controls only work while you have a file actively playing back. The other controls here include:

  • Use Windows Media Player engine for video playback when possible: This tells MC to try to use the rendering engine from Microsoft's Windows Media Player to render the file. This engine has advantages and disadvantages, but it can be useful especially for DRMed Video Media.
  • Aspect Ratio: These controls let you override the video file's source display aspect ratio to correct video files that were encoded improperly or where the player doesn't correctly determine the proper aspect ratio.
  • Audio Renderer: Lets you choose from the different available Audio Renderer filters available on the system on a per-zone basis.
  • Crop Edges: zooms the image slightly to compensate for the non-overscanned computer display.
  • Use WMV Acceleration: enables/disables hardware WMV Acceleration (I think -- is it hardware or some software optimization?)

You can also tag individual Video files with specific settings for many of these controls see Customisable Video Playback

DirectShow Filters

Customize DirectShow playback filter for individual file types in MC12.

Perhaps more importantly, if you select one of the file types from the list and then hit the Select Filters button, it opens a new dialog where you can configure the specific filters that you'd like MC to try to use to render whenever it plays that particular file type. This dialog is pictured on the right.

In this dialog, you can choose a Source Filter (maximum one), and one or more Other Filters (which are mostly just Transform decoding filters). You may choose more than one Other Filter and MC will try to render a graph using all of them. While I am not clear on the exact mechanism used to do this internally, MC essentially overrides the Merit score on the filters you choose here when a specific file type is played back. This is far more powerful than is available via modifying the Merit Scores for filters directly, because a particular filter only gets one Merit score, but may be able to handle many different file and codec types.

Please bear in mind, this dialog does not force DirectShow to use only the filters you have selected and no others. This dialog is more of a way to force DirectShow to try your particular set of filters to render the file first. As usual, if that filter combination fails (the input pins can't connect to the output pins in the graph), then DirectShow will take over and build the default graph and try to play the files. You also do not need to select both a Source and an Other filter. If you select only one component (or no components) then DirectShow will also build the default graph and render the file, but it will try to use any filters you selected first (though often these filters go together in "sets" so it may be more effective to do so).

In this same dialog, you can choose which Video Renderer to use to try to play back the file. Three choices will be available on all systems: VMR9, VMR7, and Legacy Video Renderer (Overlay). Users of Windows Vista, or Windows XP with .NET 3+ installed, will also be able to choose the Enhanced Video Renderer (EVR). Finally, users with Haali Media Splitter installed will also be able to choose the Haali Video Renderer.

Again, all of these options will be applied only to the specific media type that you had previously selected when you hit the Select Filters button in the DirectShow Playback Options dialog box.

Filter Configuration During Playback

You can also configure and work with these filters actively while the files are playing back. Simply right click in the video window inside Playing Now (or Display View) and choose DirectShow Filters. This presents you with a pop-out menu which lists each of the filters being used in the current graph, in order (with the Source Filters on the bottom and the Render Filters on the top of the stack).

Filter adjustment during playback. Inside lies a video tweaker's paradise.

From here you can select any of the presented filters and MC will launch that filter's UI. These UI's often display an informational dialog (showing frames played and stream information), but with many filters you can also make an array of adjustments to the media stream as it is being sent to the renderer (such as in FFDSHOW). Many of these adjustments work "live" (meaning that they are applied on the fly while the video is playing back. You can also choose Select Filters and configure the filters that will be used for this file type (you may have to stop and re-start playback for these changes to take effect).

From within the right-click menu while you are playing a video back you also have the Video Playback Settings choice. This will actually open up the DirectShow Playback Options dialog discussed at the beginning of this section. However, now the Video Controls will be enabled and can be used to adjust the chroma and luma controls on the fly while the video plays back.

See Also

External Links