My codec guide for Windows 7 Media Center.

Posted by Jon | Tips, Tricks & Guides | Friday 16 July 2010 12:31 pm


While not totally inclusive, I decided to document my current codec guide for playing everything I have in my media library in Windows 7 Media Center using Media Browser.  I emphasize “current” because it does change from time-to-time.  I won’t get into that, however.  There are codec “packs” out there that simplify this process for the majority, but as good as some of them are, or claim to be, I still find they install more than I want and/or take away certain levels of control I want over my playback options.  However, for the majority that just want to watch their movies, I’m sure they will be the #1 option for you and there’s nothing wrong with that.  I just don’t want to have to rely on a third-party to figure out what went wrong if something breaks.  If I know exactly what I have on my system and which components control their respective formats, then I know where to look if something goes wrong.  I also know exactly where to go if I want to adjust anything for my own preferences.

First, let me outline a few conditions of this guide:

  • I play everything within Media Browser
  • I don’t have any music files
  • I don’t use any external players
  • I don’t use full DVD/BluRay folder rips or ISO
  • I don’t have any hardware that can make use of HiDef audio formats (TrueHD, DTS-MA, etc.)
  • My HDTVs only go to 1080i
  • All titles that have subtitles use external subtitle files (srt, idx/sub and a couple ssa)
  • I encode everything, although I have stopped encoding audio.  I have a wide array of file formats because of this (I’ve encoded for a looooong time)

That said, many of you could probably get by on even less than what I’ll include here.  However, I’ve got so many file formats and codecs in my collection, I pretty much consider that I have just about anything that’s out there in my collection.

What You Need

Next, what you’ll need to get in order to use this guide:

  • ffdshow – I prefer the clsid tryout builds.  You can get both x64 and x86 versions here.
  • Haali Media Splitter –  x86 version available here.  x64 version is available in the Downloads section.
  • VobSub/VSFilter v2.39 – x86 installer is here.  The x64 dll is here.  If you absolutely, positively do not use subtitles, then you don’t need this.  Doesn’t hurt to have though.
  • CoreAVC Pro 2.0 – This is commercial software, but it’s dirt cheap and I would highly recommend it if your HTPC has a CUDA-capable GPU, or if your HTPC is on the low-end and sometimes struggles with h.264 encoded content.  Otherwise, it is optional.
  • Win7DSFilterTweaker - Windows 7 uses the new Media Foundation for playback, so DirectShow filter merits don’t apply like they used to.  This utility will set your preferred codec for you and allow you to disable any Media Foundation codecs that may still “get in the way”.

Installation

I’m not going to cover the installation of each of these softwares.  You can simply accept the default for each and every one of them.  The only exception is the 64-bit version of VSFilter.  It is a DLL and requires some work.  What you will need to do in this case is extract the VSFilter.dll to a location easy to get to (I suggest C:\Windows\SysWow64 or C:\) open a command prompt with Administrator privileges (this guide is beyond you if you don’t know how), change the current directory to C:\Windows\SysWow64 and perform the following command (assuming vsfilter.dll is in C:\Windows\SysWow64):

C:\Windows\SysWow64>regsvr32 vsfilter.dll

You should receive a confirmation window displaying successful registration.  If not, I’m sorry.

vsfilter_success

Configuration

Now for the fun part – picking and choosing from the thousands of settings that are spread across these applications!  Nah, it’s not really that bad.  We don’t need the majority of what’s available to us…if you know what you’re doing, it can improve upon your playback at times, but we’re just wanting to get things working…right?

  1. haali_configure Haali Media Splitter will be the first to configure, mainly because it’s the easiest.  Go to your Programs menu, locate it and click on the Media Splitter Settings shortcut to open.  Click the Options tab, expand Compatibility, select AutoLoad VSFilter and change the value selection at the bottom to Yes.  This will enable subs for anything Haali is used for.  Click OK and you’re done with that.
  2. ffdshow needs to be configured for both audio and video, so we’ll go over both of those separately:
    • ffdshow_audio_output Open the Audio Decoder Configuration and go straight to Codecs.  I let ffdshow handle all of my audio decoding, so the defaults should be good here.  Next, scroll down to Output and pay close attention here.  If your receiver supports any of the items listed in Pass-through, then enable it.  Mine only supports AC3 and DTS, so that’s all I have checked.  Next, ensure 16 bit integer and 24 bit integer are checked.  Further down, locate AC3 (S/PDIF encode mode) and place a check in there (if your receiver accepts AC3 via S/PDIF).  Finally, locate Connect To: and change the value from any filter to DirectSound and make certain Apply only to S/PDIF output is unchecked.  Click Apply and close the audio configuration utility.
    • ffdshow_video_configure Open the Video Decoder Configuration and go straight to Codecs.  If you installed CoreAVC Pro 2.0, you will want to set H.264/AVC to disabled.  Everything else should be assumed the default.  Scroll further down and ensure that Subtitles (or anything else, unless you know what you’re doing) is not enabled.  Click Apply and exit the video configuration utility.
  3. coreavc_configure If you chose to install CoreAVC Pro 2.0, open the CoreAVC Video Decoder Properties utility.  You will want to make sure Preferred decoder is unchecked (trust me here).  I also like to enable Use Tray Icon so I know that it’s actually being used.  Finally, if you’re using a CUDA-capable GPU, put a check in Prefer CUDA acceleration.  Click Apply and OK to close.
  4. Open Win7DSFilterTweaker by double-clicking the executable.  It does not have an installer as it’s a stand-alone application.  If you have UAC enabled, it will require you to grant it permission to run.  There are a lot of settings here and some of it may scare you if you’ve never seen it before.  Do exactly as I say and everything will be fine (knock on wood).  For the first page, set each of the following as I have outlined below (as pertains to your OS, either x86 or x64):
    • win7dsft_1 H.264 – CoreAVC (if installed), ffdshow otherwise (ffdshow DXVA if you know what you’re doing)
    • XVID – ffdshow
    • DIVX – ffdsow
    • MP4V – ffdshow
    • VC-1 – Microsoft (ffdshow DXVA if you know what you’re doing)
    • MPEG-2 – Microsoft
    • WMV1-3 – Microsoft
    • WMVA – Microsoft
    • AAC – ffdshow
    • LATM AAC – Microsoft
    • MP3 – ffdshow
    • MP2 – ffdshow
  5. mpeg_warning Click Apply after confirming the above.  You will receive a couple of dialog boxes that warn you about changing the MP2 and MP3 decoders…just click Yes.  The warnings are why we switched the Output in ffdshow to DirectSound and disabled Apply only to S/PDIF output.  If you read that warning, it told you that this was one of the tweaks that would fix it.  Well, I’ve encountered DirectSound giving me garbled audio with some formats, so I had to use Connect To: WaveOut instead of DirectSound and that resolved the issue.  Try both and if DirectSound works for you, go with it.
  6. win7dsft_2 The next page configures the containers that will be disabled for Media Foundation.  I select them all, so you should too.  Click Apply.  x64 users will get two sections…if you only have 64-bit codecs installed, just select them all on the 64-bit side (remember, this is for Media Center/Media Browser only).  If you’re on a 64-bit OS and choose not to install 32-bit codecs, Media Foundation will take care of them for you.  However, Media Center on a 64-bit platform uses the x64 version of Windows Media Playback, so it’s an unnecessary step on a dedicated HTPC.
  7. win7dsft3 The final page is for additional tweaks.  You will want to put a check in the following:
    • Disable Mpeg4s Decoder DMO
    • Disable Mpeg43 Decoder DMO
    • Disable MP3 Decoder DMO
  8. Why did we disable those in #7?  Well, the Mpeg4s and Mpeg43 are older MPEG-4 types that I’d rather ffdshow handle.  I found that it won’t unless I completely disable them here.  The same goes with MP3…the Microsoft decoder will hijack it when it exists in some containers, so it had to go.  Click Apply and Exit…you’re done!

You can now test this out.  If you’re on 32-bit Win7, you could easily try it out using Media Player.  If on x64, I’d open Media Center in windowed mode and try from there, just so you are absolutely certain you’re using the x64 Media Player and not the 32-bit version.

playback_success

Take notice of the green CoreAVC tray icon – that signifies CUDA hardware accelerated playback.  Not a biggie, except that my screenshot also shows VobSub is actively displaying subtitles.  Yes, full hardware accelerated h.264 playback with subtitles is easily handled with my setup.  Haali and ffdshow audio tray icons are also there.

As I said in the beginning, this is not an all-inclusive guide to  playback.  There are too many combinations of codecs, containers, hardware and software to make that a possibility for me to provide you.  I could guess, but that only leaves you with a headache if something goes wrong.  On the other hand, I do have a fairly common setup, so many of you should be able to follow along with these settings with no problems.

For further tips on codec configuration that may be used in conjunction with this guide, see my post on using ffdshow and AC3Filter here, or using ffdshow DXVA for hardware acceleration with subtitles here.

Update:

I thought I may include a couple of other tips that may help in case you would like to get Dolby Digital audio output to your receiver for all audio formats.  The guide, as it is, may not do that for you in all cases.

resample First, you will need the ffdshow Output section Connect To: set to DirectSound, or this won’t work for you.  The first thing we want to do is to go to the Resample section in the ffdshow audio configuration utitlity.  Place a check in it to enable it and then set the following:

  • Resample to 48000 Hz
  • Select the Resample if sample rate is radio button and click the button to choose
  • lower than 48000

This will take any audio source and make certain that it is always sampled at 48KHz.  My receiver will accept others, but I do have a mix in there and if it’s not a supported sample rate, it won’t go out as Dolby Digital.  You can also select a different setting under Mode: if you want.

mixer The next thing we’ll do is go to the Mixer section – place a check in there to enable it.  Now, go to Output speakers configuration: and select same as input from the dropdown.  Ultimately, this will take all audio formats, aside from those going directly via S/PDIF, make certain they are sample at 48KHz, transcoded to AC3 audio at 640Kbps and the output via S/PDIF to your receiver.

You can also play around with the Center, Surround and LFE sliders if things are a little off in your outputs.  I like to increase the Center and Surround to taste.  You can also change the Output speakers configuration, but don’t expect Dolby Digital output if you do.  It can be useful for 6.1, 7.1, etc. configurations, however.  It will go out PCM, but does sound really nice if you have one of those speaker configurations.  I do it in my living room :)

  • Share/Bookmark

ffdshow DXVA with subtitles? I think so.

Posted by Jon | HTPC | Monday 1 March 2010 9:32 am

I was messing around with my codecs this morning and decided to update my ffdshow installation to clsid’s revision3291 (32-bit).  I don’t remember the last revision I had, but I know it did not have the new DXVA decoder available for h.264 and VC-1 sources.  What really piqued my interest, was that it included settings for subtitles.  DXVA+subtitles+ffdshow?  I had a hard time accepting it, but I was interested enough to give it a test run.

This is not really a guide because I’m not going to cover everything necessary to get all of this working.  I stopped using Shark007‘s codecs a little while back because I had issues in getting settings to stick for me.  I decided to go back to using Win7DSFilterTweaker which allowed me to install and configure only what I wanted, the way I wanted.

The only codecs I have installed (x86) are clsid’s ffdshow revision 3291, Haali Media Splitter 1.8.122.18 and AC3Filter 1.63b.  That’s all I need and it’s all I use (I use Microsoft’s default TV/DVD codecs).  I used the Win7DSFilterTweaker to allow ffdshow as my preferred codec for just about everything aside from TV/DVD sources.  I may do a separate guide on that later, but I’m pretty sure you can find one if you spend a minute or two on Google.

The first thing you want to do, is to make certain h.264/AVC is not enabled in the standard ffdshow decoder…it must be set to disabled.

disable_decoder_h264

Next, open the ffdshow DXVA decoder properties and go to the Hardware acceleration section of the menu.  Check to enable H264 and, if you want, check to enable VC1.  The next part is concerning subtitles, so if you don’t use them, you can actually skip this part and be done.  Go down to the Post processing drop down menu and select Surface overlay.  Subtitles will not work if you do not enable that setting.

hardware_acceleration_tab

Next, go to Subtitles in the menu and make sure there is a check mark present in the box to enable it.  You can pretty much accept defaults here, but I also make certain Accept embedded subtitles is checked for compatibility with some of my files.  The rest of the settings you can play with to taste, but that’s all that’s needed to get them working.

subtitles

You’re done.  If Win7DSFilterTweaker has been used correctly to setup your codecs, Media Center is ready for your HD MKV files with hardware accelerated decoding…including subtitles.

Now, the bad news…for me anyway.  I was never able to see any signs of hardware acceleration using this.  The DXVA decoder was definitely being used and I downloaded properly encoded h.264 and VC-1 files to make sure it was not just my own files, but I never saw a decrease in CPU usage nor elevated use of my ATi HD 2600 Pro GPU.  I’m hoping it was just my hardware or driver (using latest Catalyst), but I just could not get it to give me any kind of reassuring results.  I tried in Media Center, Media Player and Media Player Classic Home Cinema with identical results.

I would like to know what any of you get if you decide to try this, however.  I’m perfectly happy without hardware acceleration as what I use plays my 720p encoded files perfectly fine.  This is some good ground-breaking for ffdshow though!

  • Share/Bookmark

DivX 7: h.264 is in there!

Posted by Jon | Off Topic | Tuesday 27 January 2009 1:37 pm

It’s not exactly new news as there have been several beta versions and an alpha already released, but I decided to sign up so that I could download it for the first time this past weekend.

I’m talking about the latest DivX 7.0 package which now includes an h.264 codec for playback on its included DivX media player.  I played a few minutes of a a 720p movie I had and it worked, so yay for that.

I also joined their new project team and downloaded the DivX h.264 CLI encoder they have.  I’ve not used it yet, but I think I’ll give it a test run on the next DVD/BluRay disc I get.  I’ll see if I can do a comparison test using similar encoding methods with the x264 encoder.  They both go use the same frame serving and scripting software, so it may not be that hard.  I’ll post my results if and when I get around to doing that.

  • Share/Bookmark

h.264 and VC-1 in VMC? Yep.

Posted by Jon | Announcements | Friday 23 January 2009 10:24 am

I came across an interesting blog post explaining how to setup Vista Media Center for playback of MKV with true hardware acceleration (so long as you have the necessary hardware) using filters from Media Player Classic Home Cinema.  I have not tried this myself and I probably won’t do much playing around with it as it appears the fatal flaw is subtitle support.  However, that alone may be reason enough for me to give it a run – just so I can find a way to support subtitles (whether they be embedded in the MKV or external).

Anyway, here is the link to the blog post in case you’re curious to try this yourself.  Enjoy the link!

  • Share/Bookmark

Encoding and Aspect Ratio Tip.

Posted by Jon | Tips, Tricks & Guides | Friday 7 March 2008 11:11 am

Last night I put on The Condemned as I had not seen it and was in the mood for some action. Once it started, I noticed that there was something odd about the way it was displayed on the screen. I knew it was a 16:9 movie and I have a 37″ Hannspree XV37 widescreen LCD in my bedroom, but it was displayed more like a 4:3 movie with no black bars. Something was wrong.

I have this movie in Blu-Ray, so I checked it out. Sure enough, it’s in 1.78:1 widescreen. I then used MediaInfo to check the details of the mp4 I had encoded. I reduce the resolution to an acceptable one for most all my HD movies. It saves on space and still provides an excellent picture. For this one, I used a resolution of 800×448. However, for some odd reason, it had a PAR (picture aspect ratio) of 1.5:1. Crap.

Well, I’m pretty picky about things like this and I refused to watch the movie. But I’m also too stubborn to submit myself to ripping and encoding this thing all over again. What ever will I do?

After some Internet scrounging, I found out that MP4Box can alter the PAR. I already had YAMB installed, so I just took the MP4Box executable out of there and dropped it in my C:\Windows directory. I coped The Condemned to a local directory from my server and renamed it to take out the space, then ended up using this command:

C:\>mp4box -par 1=1:1 x:\archange\condemned.mp4

After it completed the ISO writing, I opened it up in MediaInfo and voila! 800×448 (16/9) love! I renamed it, copied it back over to my server, and went back to bed to watch Band of Brothers instead.

So, if by mistake, you or your encoding software incorrectly sets your PAR to something other than the intended one for your mp4 files, this is a good way to change it. Keep in mind that it may not always be 1=1:1, however. I ended up having to change a couple of others using 1=8:9 (which is 4:3 fullscreen) and 1=32:27 (which is 16:9 widescreen). These were encoded in true DVD resolutions of 720×480, but were showing a 1:1, which made them display at 1.5:1. For fullscreen material, this looks very close. It’s not acceptable for widescreen, however.

I could get into PAR, SAR (sample aspect ratio), and/or DAR (display aspect ratio), but I’m afraid I’d just confuse my point here. I’d probably confuse myself as it can be harder to preach than practice.

Hope this helps someone out. Let me know what you think (comment/register). Happy encoding!

  • Share/Bookmark
Next Page »