Vista MCE Codec Bible
As codec conflicts are inevitable as soon as you install several applications that do the same thing, and as there is NO single Codec Pack that just makes everything work, I'm sharing my experience on configuring DivX, XviD and MKV playback for maximum quality and feature support.
This is especially important for those who need subtitles, multiple audio streams, and features like resuming, fast forward and rewind in Media Center -- all sorely lacking in the default setup.
I've extensively researched workarounds and solutions for common problems, limitations and annoyances, like the Haali media splitter crashing with subtitles, FFDShow picking the "right" subtitle file (if properly named) but unable to detect alternate-language subtitles for the same video, the impossibility to fast forward and rewind DivX and XviD movies in Media Center, the lack of resume support for the same files, the DivX codec on its own being unable to correctly play a "BivX" (DivX with multiple audio streams, e.g. the movie and the commentary, or two audio languages) without losing audio-video synchronization, the high CPU usage of some codecs and filters versus the low quality of others, etc.
What works for me is the following series of products installed on my MCE, installed in this order:
- AC3 Filter (recent version, currently 1.51a)
- FFDShow (always a very recent version), custom install: see below
- DivX Pro 7.x
- AutoGK 2.55 with all defaults
- XviD (included in AutoGK)
- Gabest VobSub (included in AutoGK)
- DirectVobSub: VSFilter version 2.39, installed after the one included in VobSub above
- Haali Media Splitter (necessary to play .MKV "Matroska" files)
- Headband GSpot video analyzer 2.70a (used to check which codecs are used and in which order, and to change codec priorities, although it cannot directly analyze .MKV movies)
- MediaInfo (most recent version) (used to check .MKV movies)
- MediaControl (most recent version)
Making it work for DivX / XviD AVIs:
NOTE: when (re-)installing FFDShow, preferably use the following options:
- at the "Select Additional Tasks" dialog, enable "Reset all ffdshow settings"
- disable (you need to click twice) everything under "decode the following video formats" and "decode the following audio format"
- enable just the "MP3" format with Libavcodec selected
- at the bottom of the list, enable Volume Normalization and Subtitles.
NOTHING else for now. In Speaker Setup (next screen), choose your setup correctly, or just pick 2.0 (stereo) [see below !]. If asked to restart: do so.
- open the FFDShow Audio Configuration tool:
- under "Show / Hide filters", remove all except "Volume" and "Mixer";
- enable "Stream Switcher";
- in "DirectShow Control", check that the "Merit" is set to "FFDShow Default";
- enable OSD: uncheck "Current Bitrate", and select "Decoder" and "Encoder info";
The Volume filter can allow you to normalize volume or increase surround; the Mixer will modify the audio stream to fit your speaker configuration.
Note: if MP3 audio doesn't play correctly in movies, you may associate MP3 audio with LibAvCodec here. If AAC and/or AC3 don't work, you can enable that here too. These steps are actually necessary if you want to play "BivX" (dual-audio avi) movies.
- open the FFDShow Video Config:
- under "Show / Hide filters", remove all except "Subtitles" and "Post-processing";
- enable Post-processing: enable Automatic Quality Control, uncheck mplayer;
- in "DirectShow Control", check that the "Merit" is set to "FFDShow Default";
- Codecs: at the end of the list, change "Raw Video" to "All Supported", then enable "Enable in WMP11";
- Output: enable "I420/IYUV", "NV13" and "High Quality YV12 to RGB conversion";
The "Raw" option in the Codecs ensures that FFDShow Video is always used when decoding movies; it won't do the actual decoding, but act as a "middle man" which allows other stuff, such as displaying subtitles, but more importantly, it'll allow us to have Automatic Resume as well as fast forward and rewind for nearly all video formats [requires MediaControl: see below].
- open the DivX Decoder Configuration Utility:
- Decoder tab: disable "De-Interlace Video", enable all other options;
- Toolbar tab: enable all, choose your default audio & subtitle language;
- Playback tab: enable "Full Deblocking with Sharpening" post processing, leave all other defaults;
These options ensure that the DivX Pro Codec is used as default for DivX, XViD and related formats, with Full Deblocking & Sharpening enabled (say what you want, it displays much better than XViD's decoder or FFDshow on its own).
Leave "DivX Logo Watermark" ON, it'll help you verifying that this codec is being used.
- open XVid's Decoder configuration utility:
make sure it is NOT the default for anything (uncheck all under FourCC support), and enable the four deblocking and dering options. I'm just keeping XviD for encoding, and as a backup if DivX has a problem with a file.
- open the DirectVobSub (VSFilter) configuration tool:
- In the Main tab, click on the Font name, then again, and choose a high clarity font like Segoe UI or leave Trebuchet MS; increase its font size to e.g. 16, 18 or 20, set it to regular (instead of bold) and click OK. Then reduce the border and shadow sizes to 1 or 2 and click OK again.
- In the General tab, make sure Resolution Doubling is set to "if smaller than 1279x719" OR: just set to "double resolution" - see below.
- In the Misc tab, enable "Apply Changes Immediately".
- In the About tab, verify that you're running version 2.39. If not: see the installation list above.
Don't worry if an error occurs after quitting the DirecVobSub configuration, it's normal if you started it on its own. This doesn't happen if you double-click the "green arrow" that appears in the system tray while playing a movie with subtitles played through DirecVobSub.
On Resolution Doubling: 1279x719 is what works for me. It'll double the movie size (and subtitle resolution, making them much nicer) for all movies that are any size up to 1 pixel smaller than a standard .MKV 720 lines movie. Above that, you MAY only see half the picture with this option enabled. This setting may not be right for all users. Some may be able to use "Always double resolution" in all cases, or may have to set it to "1919x1079" (1 pixel smaller than 1080 lines)... just try it out with a 1080p .MKV movie and see how far you can go.
- open the AC3Filter Config tool:
- in the Mixer tab, enable Auto gain control, Auto Normalize, Normalize Matrix, Voice Control and Expand Stereo.
- in the Gains tab, and set some Gains (automatic volume increase) for AC3 audio (which is often too quiet): e.g. "14" for Gains Master, "12" for Voice and "8" for Surround.
- in the System tab, enable AC3 for all except PCM (although: see further below).
Note that the "Output Format" present in different tabs depends on your actual system. Select what corresponds to your actual audio outputs, not the number of speakers you have. If you have 4 speakers but they're connected using a single "Audio Out" on your computer and not Front and Rear separately, you must select "2/0 Stereo".
- opening movies for analysis and codec / filter tweaking in HeadBand GSpot:
- first time in GSpot: in Options, Settings, uncheck "Enable full scan" (don't need it) and enable all options under "System Interaction". You can now change Codec and Filter "Merits" (= priorities) and (un)register codecs and filters using this tool. Close it.
- locate a DivX-encoded .AVI file on a hard disk
- right-click it, click Open With, Choose Default, UNcheck "Always use the selected program" !, then locate GSpot (either in Other Programs, or through Browse...) and click OK to confirm. It'll now appear directly in the Open With menu for this type of file.
- "Render" the video and audio (press the "1, then "2" buttons under "GSpot, Vid" at the bottom left) and inspect the different paths ("graphs") chosen.
- Each line is a different "path" between the source and its final display in a video program (e.g. source -> splitter -> ffdshow -> codec -> renderer).
- If a line is pink or red (= failed to render), this "path" doesn't work. If it's green, it's ok.
- You need the first and/or second line to be green, else it'll take longer to load movies of this type, because the player will try a method that doesn't work before trying something else. The same applies not only to AVI files, but to other formats too...
- If the first line is the rendering path with "FFDSHow Video Decoder", it should be red here, and you should leave it like that.
CAUTION: the line with "FFDSHow Video Decoder" SHOULD be red, because DivX and XviD decoding are disabled in FFDShow, so it won't understand them on its own. While we could fix this by lowering ffdshow's merit, we won't ! If we do this, ffdshow won't load for DivX / XviD movies decoded by DivX Pro. And if you want to know why we still need FFDShow to load, read on until the end.
- If e.g. "BadCodec" (just a sample name) is the 1st line and displays in pink / red:
- go to Options first and enable Expert mode.
- go to System, List Codecs and other Filters, sort the list by Merit (highest on top)
- find where "BadCodec" is. It may appear several times; find the "BadCodec.ax" or "BadCodec.DLL" which has the word "XViD" or "DivX" in the "Formats" column; otherwise, look for any instance of "BadCodec"
- right-click it, then set its Merit to "Normal" or "Preferred". Close this window.
- click on the System menu, the Reload Filter data (do this after any filter / codec / merit change, else GSpot won't take your changes into account !)
- render again using the buttons at the bottom left.
- look what's changed... tweak this until you have satisfactory results.
- If changes in the Codec & Filters list are not reflected here at all, first close & reopen GSpot, and if that's not enough, reboot your computer. Note that you can right-click any item in the Render Path results, and see details; often you can open the filter or codec's properties to change them right there. To change a Merit (priority) directly however, you need to go through "List Codecs and other Filters" as above).
- Do the same for XViD-encoded AVI files, and other formats if needed...
- Then you need to do basically the same for the Audio rendering.
- In my system, the paths for AVI rendering under "GSpot / Vid" are now as follows:
(Src)-->>--(A)-->[AVI Splitter ]>--(B)-->[ffdshow Video Decoder ]>--(C)-->[Video Renderer ]
Failed to connect Output pin 0x06c6da9c ("Stream 00") on AVI Splitter to input pin 0x076c7f6c ("In") on filter 0x04f82b1c ("ffdshow Video Decoder").ConnectDirect() failed. Error: 0x80040207: [unknown]
(Src)-->>--(A)-->[AVI Splitter ]>--(B)-->[DivX Decoder Filter ]>--(C)-->[Video Renderer ]
Video Render OK. Use [3] to play.
(Src)-->>--(A)-->[AVI Splitter ]>--(B)-->[Xvid MPEG-4 Video Decoder ]>--(C)-->[Video Renderer ]
Video Render OK. Use [3] to play.
(Src)-->>--(A)-->[AVI Splitter ]>--(B)-->[VFW:XviD MPEG-4 Codec ]>--(C)-->[Video Renderer ]
Video Render OK. Use [3] to play.
The stuff in red above shows that FFDShow failed to render this video "on its own". That's quite normal, because DivX and XviD decoding are disabled in FFDShow (change those options temporarily and you'll see this line will be green too).
- Once the steps above have been taken to correct video rendering using "GSpot, Vid", you now need to render again, but this time by pushing the "1" button under "MS A/V". This shows what will actually happen when playing a movie in either MCE or WMP.
It'll only show two lines, the 1st is Video and the 2nd is Audio. NOTHING may be RED here !!
- The best "MS A/V" rendering path for DivX AVI files at this stage is the following:
(Src)-->>--(A)-->[AVI Splitter ]>--(B)-->[DivX Decoder Filter ]>--(C)-->[DirectVobSub (auto-loading version) ]>--(D)-->[Video Renderer ]
(Src)-->>--(A)-->[AVI Splitter ]>--(B)-->[ffdshow Audio Decoder ][Default DirectSound Device ]
or
(Src)-->>--(A)-->[AVI Splitter ]>--(B)-->[DivX Decoder Filter ]>--(C)-->[DirectVobSub (auto-loading version) ]>--(D)-->[Video Renderer ]
(Src)-->>--(A)-->[AVI Splitter ]>--(B)-->[ffdshow Audio Decoder ]>--(C)-->[AC3Filter ]>--(D)-->[Default DirectSound Device ]
- Difference between the two: the second one is a configuration where the AC3 Filter is also used for MP3 audio in movies. To enable this, open ACE 3 Filter config, System tab, and enable the "PCM" option under "Use AC3 Filter for".
- Now these results still don't show FFDShow being used in the Video rendering path, so we'll need to tweak something. The problem is that the default Merits that you can choose from always put FFDShow either too high or too low.
So proceed as follows:
- close GSpot;
- open FFDShow Video Config, go to DirectShow Control;
- set its Merit to "FFDShow Default", then click OK;
- Open GSpot again, go to System, List Codecs and other Filters, maximize this and sort by Merit (high to low);
- right-click the "Divx Decoder Filter" (divxdec.ax) and set its Merit to the maximum you can set using the cursor (that's 0xf00000), then click OK;
- right-click the "ffdshow Video Decoder" (ffdshow.ax) and set its Merit to the maximum you can set using the cursor (that's 0xf00000), then change that to 0xff0000 and click OK;
- likewise, change the Merit for FFDShow Audio Decoder to 0xff0000 ;
- click Done, System, Reload filter data, List Codecs and other Filters, maximize it and sort by Merit (high to low) again;
- This should be your filter order:
- MPEG Video Decoder (quartz.dll)
- MPEG Audio Decoder (quartz.dll)
- ffdshow Video Decoder (ffdshow.ax)
- ffdshow Aideo Decoder (ffdshow.ax)
- DivX Decoder Filter (divxdec.ax)
- Now try rendering again in GSpot
NOTE: if you have other filters from e.g. Sonic, Cyberlink, Nero, Roxio or others occuping those "top" positions, either lower their Merit or unregister them. If they are used to "split" or "decode" any of the formats used by Media Center, they'll cause unpredictable behavior. Also, you must make sure that Microsoft's MPEG video and audio decoders are always at the top of the list, as these are used for Recorded TV in Media Center. See below in the Matroska section for details.
- The final expected results should the be as follows:
- using "GSpot Vid" rendering buttons 1 then 2: rendering using FFDShow should come first and be red, then rendering with DivX Decoder Filter should be 2nd and green, and others like the XviD decoder will come after and be green (if enabled for that file type) or red (if disabled) should be second and red. I don't care about the others.
- Using "MS A/V" rendering button 1:
(Src)-->>--(A)-->[AVI Splitter ]>--(B)-->[DivX Decoder Filter ]>--(C)-->[ffdshow Video Decoder ]>--(D)-->[DirectVobSub (auto-loading version) ]>--(E)-->[Video Renderer ]
(Src)-->>--(A)-->[AVI Splitter ]>--(B)-->[ffdshow Audio Decoder ]>--(C)-->[AC3Filter ]>--(D)-->[Default DirectSound Device ]
... you can see in the 1st line that the FFDShow Video Decoder now comes after the DivX Decoder in the same rendering path.
If FFDShowVideo Decoder doesn't appear at all in your case, try opening FFDShow Video Configuration, go to Codecs, and enable libavcodec for DivX 4/5/6 and for XVid temporarily. Save, then render an XviD and a DivX in GSPot. Back in the codecs screen, re-disable XViD and DivX 4/5/6 and save, then back to GSpot (reload !!) and render again using MS A/V. Now FFDShow Video Decoder should appear... don't ask me why.
Now for Matroska's .MKV movies:
Load a .MKV high-res movie (720p or 1080p) in MediaInfo and verify that it uses an AVC video stream and an AC-3 Audio stream like proper HD rips should (note: .MKV movies don't "have" to be HD, there are also low-definition MKVs. If it's over 1 GB for a 40-minute series episode, it's probably HD). Close MediaInfo. Open the same file in GSpot. You can only render using MS A/V, the other rendering options are disabled: press the "1" button to render.
NOTE: Haali vs. Gabest's Matroska Splitter: Gabest's Matroska splitter has issues where .MKV movies in 1080p would inexplicably "stutter" when played from a LAN device (e.g. a NAS box), and testing showed that Haali doesn't have this problem. To avoid subtitle issues with Haali, make sure it doesn't handle the subtitles (DirectVobSub should do that).
Check your rendering results. If you see 3rd party filters or codecs like e.g. "Nero Splitter" (but this also applies to stuff from Sony / Sonic, Roxio, ...), proceed as follows - BE CAREFUL!!.
Lowing the Merit of / Unregistering Unwanted Filters and Codecs:
- go to System, List Codecs and Other Filters, maximize it, sort by Merit (highest on top)
- find the offending filter or codec, e.g. the Nero Splitter, right-click and Unregister it.
- if you NEED this splitter for some reason, you may instead give it a very low Merit ("Do Not Use").
- now try rendering again (you may need to close & re-open GSpot).
- you may have other filters, e.g. from Roxio, Nero, Cyberlink or Sonic, that also get in the way. Some can be Unregistered, others need to be "lowered" in Merit, else some tools (e.g. Roxio video editing tools) may not work anymore. Especially lower any "splitter" filter from those 3rd parties.
You should see the following:
(Src)-->>--(A)-->[Haali Media Splitter ]>--(B)-->[DivX H.264 Decoder]>--(C)-->[DirectVobSub (auto-loading version) ]>--(D)-->[Video Renderer ]
(Src)-->>--(A)-->[Haali Media Splitter ]>--(B)-->[AC3Filter ]>--(C)-->[Default DirectSound Device ]
FFDShow's "Raw Video" option: Why you should enable this
Wonder why I insist on using FFDShow and having it enabled for all types of video (through the "Raw Video: All Supported" setting in FFDShow video config) ?
Because it's the only way -- in conjunction with the excellent Media Control tool -- to enable Fast Forwarding, Rewinding and Resuming in DivX and MKV movies.
Media Control for Windows Media Center
You can download MediaControl from http://damienbt.free.fr/index.php.
Current version is 6.0.2 You need to have .NET installed first, but due to a bug in the installer, MediaControl may continue to prompt to install it. Ignore this and continue the setup.
Mind the following options, which you need to set through the Media Control Configuration Program:
- in the FFDShow Configuration tab, click "Apply MINIMAL configuration", then Commit Changes. DO NOT USED "Apply recommended config" -- it'll screw up your ffdshow setup (will disable using the DivX Pro codec, etc...);
- IF you have the Windows Vista Media Center TV Pack 2008, you need to go to the "Notifications / Tricks" tab and disable the "Use Media Experience" option;
- Fast Forward and Rewind only work with a Microsoft Media Center Remote (or fully compatible), not with a mouse or keyboard buttons, and not with Vista's own on-screen buttons;
- Resuming movies (playback from where you left off) should also work now;
- All these options only work when playing a movie from Media Center, and if Media Center was started "normally". If you right-click a movie in Explorer and "Open With" Media Center, MediaControl won't be loaded.
Note that Media Control can also be used to "add" FFDShow processing to Live TV, Recorded TV and DVD Playback in Media Center. This would enable picture improvement, rescaling, removal of black bars, etc. for those video sources. I haven't really experimented with it.
Also, Media Control can be used to assign "macros" and some direct commands to your MCE Remote. Among other things, you can use the Direct Commands to change the subtitle stream on the fly, without needing to minimize MCE to go to the DirectVobSub icon.
Audio Stream switching is theoretically also possible, but I couldn't get it to work for "BivX" movies.
Macros are launched through a "prefix" key (the Yellow button by default). They can be used for almost anything, from launching keyboard commands to starting external programs.
Direct commands are accessed during playback by pressing the Up key on the remote; then you can use the Left & Right keys to scroll through the available commands, and Up & Down to change the values.
... and what now ?
Now you can try playing media files in Media Player by double-clicking them in Windows Explorer. If everything has been done correctly, you'll see the following icons in the System Tray when opening a DivX or XviD file:
- the DivX 7 Decoder icon [so we know it's DivX with full deblocking & sharpening that's been used]
- the FFDShow Video Decoder icon (the red square) [ok: video also passes through FFDShow]
- the FFDShow Audio Decoder icon (the blue square) [ok: audio also passes through / decoded by FFDShow]; this will display for XviD and DivX movies, not not for .MKV if you followed my recommendations
- the AC3Filter icon (a weird yellow-orange blob), if the audio is AC3 of if you've enabled AC3Filter for PCM
- the DirectVobSub (green arrow) icon, if you have external subtitles for that video (SRT/SSA/SUB...)
When movies are decoded through the Divx Decoder, you'll also see the DivX logo as a watermark at the bottom right of your video for about 5 seconds each time you start playing a video. I leave this on to ensure I'm always using this codec (upgrades etc. can change the codec merits !).
You can right-click on the green arrow icon (DirectVobSub) in the system tray to change subtitles or to change audio streams if there are several. You can then also see which audio / video filters & codecs are in use to play this file.
Right-click the blue FFDShow icon to switch audio stream as well, and to enable / disable its filters, if any. The same goes for the red FFDShow icon. Both FFDSHow icons allow you to enable / disable their OSD, which shows additional info in the video window, which is great for troubleshooting when you're starting. Advice: configure the OSD for Video to display CPU Load, Input and Output description, Input Size, Encoder and Decoder info. For the audio OSD, use the same except Output description and Input Size.
Caveat: with the setup I've explained here, double-clicking a DivX or XviD video file in Windows Explorer, in order to play it in Media Player, will cause the following problem if this file has no subtitles: it will take longer before it starts playing, and the DivX system tray icon will appear and disappear several times. This is a consequence of passing all raw video through FFDShow, and there is no workaround for this in conjunction with the DivX 7 codec. No problem though: this does not occur when playing in Media Center... ![Smil]()
" src="http://thegreenbutton.com/emoticons/emotion-1.gif" mce_src="/emoticons/emotion-1.gif">.
You can now open the file in Windows Media Center too. In order to properly monitor the results, proceed as follows for testing:
- Open Windows Media Center
- "Restore" it to "non-maximized" size (play as a window)
- Using Windows Explorer, locate your test movie files: a DivX AVI, an XviD AVI and a HD .MKV
- Right-click the DivX-encoded AVI first, and using "Open With", add Media Center to the "Open With" list, but do NOT set it as default !. See way up above here if you've forgotten how to do that
- the file should play, with the OSD information (from FFDShow) appearing on the left side;
- you should see the DivX, FFDShow Video, FFDShow Audio (for MP3 sound) or AC3Filter (for AC3 Sound) or both, and optionally DirectVobSub (if using external subtitles) icons in the System Tray;
- if you have multiple subs or audio streams, you should be able to switch them using thos DirectVobSub or FFDShow Audio icons;
- now do the same for the XviD-encoded AVI: the results should be identical, and you should also see the DivX watermark when you start playing;
- if not: you need to lower the merit for the "XviD MPEG-4 Video Decoder" (xvid.ax)
- now do the same for the HD .MKV file: similar results except FFDShow Audio Decoder won't appear, and the AC3Filter icon must appear. OSD information for the audio will not be available.
Conclusions:
This method for configuring your codecs gives you the following advantages and features:
- Best image, by using DivX 7 with full deblocking & sharpening for DivX, XviD and other MPEG-4 video types, and for MKV files (using its DirectShow H.264 decoder)
- AC3 audio with Gain Control, Voice Enhancement and Surround Enhancement for files with AC 3 audio (and others if you wish);
- Audio Stream Switching (through FFDShow and DirectVobSub) for movies with multiple audio streams (e.g. "BivX");
- High-resolution, polygonized, shadowed and outlined external subtitles (text-based, like SRT, SSA,... and SUB bitmap format) (through DirectVobSub);
- Subtitle auto loading and switching (through DirectVobSub and Media Control);
- Support for Auto Resuming, Fast Forward and Rewind for DivX, XviD, generic MPEG-4, Matroska and other video formats from Windows Media Center, when used in conjunction with Media Control (requires passing all video through FFDShow);
- Support for Macros, Direct Commands and FFDShow Profile Switching (through Media Control);
- Thumbnail support for DivX, Xvid, generic MPEG-4, Matroska, and other video formats within Media Center (note: in my recommended config, thumbnail generation in Windows Explorer is disabled - those MKV files are way too large);
- This setup allows you to benefit from the advantages -- and overcome some new problems and limitations -- of Vista Windows Media Center TV Pack 2008.
Resources and Downloads:
OK That's it for now. 
Last updated: 19 September 2009, 20.10 CET
______________________________________________________________
Also check out my post on Changing Vista Media File Associations in this thread:
http://thegreenbutton.com/forums/thread/314597.aspx
Greetings,
Frank.
______________________________________________________________