Use Windows 7’s built-in h.264 decoder in Media Player Classic Homecinema

On Windows, I always install the CCCP to get all of the codecs I need.  It’s a nice pack of mostly open source software.  Most of the audio and video decoding functionality it provides is provided by libavcodec from the FFmpeg project — this library also powers the decoding of VLC, Perian, and most notable media players on Linux.  With the CCCP, this is provided in the form of FFDShow, a set of DirectShow filters that can be used by any Windows application that supports DirectShow.  The CCCP also includes Media Player Classic, a nice, light player, pre-configured to just play everything right.  No thinking involved, just install the CCCP.

However, I find that libavcodec is not fast enough to decode high-bitrate h.264 content in real-time on my machine (2.4 GHz Core 2 Duo) — say, for example, the h.264 content that you would find on a Blu-ray disc.  So, I set out looking for alternatives.

The most obvious choice is CoreAVC (although that will cost you $15!).  They boast having the fastest software h.264 decoder available — and they’re probably right.  I downloaded the trial version and found that it allowed my computer, for the first time, to play back a Blu-ray encoding without stuttering or hiccuping or dropping frames.  Unfortunately, my particular Blu-ray movie (Stargate: Continuum) apparently was encoded by some encoder that did not follow the AVC spec completely, and thus, CoreAVC has some decoding errors (although the video is decoded fine by libavcodec, if a bit too slowly).  I’ve been promised that a workaround for this issue will be present in CoreAVC 2.0, which may come along at around the same time as Windows 7’s general availability.

There’s also hardware-assisted decoding.  Maybe if you have a good GPU, this is an option.  On my machine, the GPU supports h.264 decoding, but it is even slower than libavcodec.

Another option is just to use Windows 7’s built-in h.264 support, that I had read about at some point, but completely slipped my mind until after I checked out CoreAVC.  So, here’s how to configure Media Player Classic to prefer Windows 7’s native support over that provided by FFDShow.

First, go to View -> Options.  Select “External Filters” on the left, and then click “Add Filter” in the top right.  Find “Microsoft DTV-DVD Video Decoder” and click “OK.”

Using Microsoft h.264 filter in MPC - 1

Now, select this filter in the list of filters, and choose the “Prefer” option on the right.

Using Microsoft h.264 filter in MPC - 2

This filter will take over the playback of some other types of media as well.  If you don’t want that, remove everything except the h.264 subtype and the subtypes in {braces} from the list at the bottom of this window.

Press “OK,” and then close and restart Media Player Classic.  And then, enjoy your h.264.

Using Microsoft h.264 filter in MPC - 3

(By the way, this is the h.264 encoding found on the Blu-ray disc, and it has not been re-encoded or re-compressed or anything.  I had to rip it because that’s the only way I could get it to play at all… but that’s another story.)

If you ever decide you want to undo this, just go back to the “External Filters” config and remove the Microsoft DTV-DVD filter from the list, and then restart Media Player Classic again.

I’ve found Windows 7’s native support to be faster than libavcodec, but slower than CoreAVC.  It also doesn’t have any of the decoding errors that I saw in CoreAVC.  It is almost fast enough to play the movie on my system, but I still notice some slight stuttering.  I’ll live with it until CoreAVC 2.0 is available, and then we’ll see how that stacks up.

29 thoughts on “Use Windows 7’s built-in h.264 decoder in Media Player Classic Homecinema”

  1. I’m not sure why you are using an obsolete version of MPC-HC when there is up to date versions.

    The MS DTV-DVD Video Decoder even in the Win7 RTM is known to be buggy and slower than the latest libavcodec from the latest builds of ffdshow. It’s all been tested on doom9 forums.

    Also you’re doing it wrong if GPU decoding is slower than libavcodec, I get 20% CPU usage even on 40mbps content with hardware decoding.

  2. Hi, my experience with libavcodec is not limited to the CCCP, I have actually tried a number of more recent versions under Linux with the same result — not quite fast enough to decode the Blu-ray encoding on my machine. That said, I’ll try and dig up a newer one on Windows and see how it performs. Someone mentioned this to me on the CoreAVC forums as well, I just haven’t gotten to it yet.

    I’ve tried several different ways of getting GPU-assisted decoding as well, including just using CyberLink PowerDVD with hardware acceleration enabled, CoreAVC with NVIDIA CUDA support enabled, and mplayer with the NVIDIA VDPAU patch under Linux. I think the poor performance from my GPU is due to the fact that my poor laptop has a GPU on the bottom-end of the ones that support h.264 decoding, unfortunately.

    In any case, this post was not intended as a recommendation to use Microsoft’s h.264 decoder, but rather as informational directions on how to use it in MPC if that happens to be what you want to do. Aside from that, I posted a bit of my personal experience on the performance of the various options and I intend to make a follow-up to this post in a couple of months when CoreAVC 2.0 is available. By then I should have had a chance to mess around more with libavcodec as well.

  3. That’s why I’m suggesting you install up to date versions of MPC-HC and ffdshow, from what I see from your screenshots, you’re using the obsolete, 1 year old CCCP 2008-09-21. A lot has changed in 1 year when it comes to decoding efficiency.

    The MS decoder has been benchmarked on doom9 forums to be around the same or less efficient than the latest ffdshow libavcodec builds.

    And to prove my point, here’s Nvidia integrated graphics doing full 1080p decoding with very little CPU usage.

    “If you configure MPC-HC as I described above you’ll get full hardware acceleration on the Ion board. This is a great way of watching your own ripped content. Without encryption CPU utilization ends up being in the 10 – 14% range, allowing you to even do things in the background while you’re watching a video.”

    See what I mean? There’s no way a CPU only decoder is faster than the decoder unit in the GPU.

  4. Thought I’d post a note that I’ve been experimenting some more today. The results:

    Using the latest CCCP beta (which has FFDShow-tryouts 2009-08-05, I believe, and MPC-HC 1.2.1209.0) doesn’t really give me much of a performance boost when trying to play back the Blu-ray encoding. It’s still too slow. It also stutters much more than the Win7 native decoder. I know you say that libavcodec should be faster, but that simply doesn’t seem to be the case on my machine.

    As for your comment that “there’s no way a CPU-only decoder can be faster than a GPU,” there are benchmarks around (one example) that indicate that this depends on your CPU/GPU combination and the decoder you use, but it’s entirely possible for a CPU-only decoder to be faster.

    I wasn’t able to get hardware decoding working in MPC using the anandtech link you provided. However, I did use these instructions and got it to working in MPC. Hardware decoding is still slower than everything else I’ve tried. It works fine for lower-bitrate encodings, though. (For the record, I’m using a NVIDIA GeForce 8600M GT.)

    I’m just lost until CoreAVC 2.0 comes along. :-P

  5. Those benchmarks are useless. Notice those are previous generation GPUs? They don’t do the full decoding process on the GPU like the new generation GPUs. Corecodec has been perpetuating that lie for a long time.

    No CPU decoder is faster than a dedicated hardware decoder that does all the decodings steps in hardware. Sorry that you choose to believe the lies of Corecodec.

    There’s no way hardware decoding is slower, I’m not sure why you keep up with that misinformation.

  6. I forgot to mention that the MS Win7 decoder does use DXVA decoding on compatible hardware, so that could be the reason why it’s faster than libavcodec.

  7. If you say so. In any case, CoreAVC (running in software-only) runs faster on this machine than any hardware-assisted method that I have gotten to work.

  8. How can it run faster when the CPU usage is clearly higher than hardware decoding? Maybe you can explain how you find CPU only decoding to be faster, considering CPU decoding is wasteful and less efficient(the whole CPU cannot go into low power idle mode when decoding) than the GPU decoding(only the decoder unit is active in the GPU).

    And the Nvidia Ion IGP is paired with an Atom CPU, which is far weaker and slower than a Core 2 and yet Anandtech gets low 10-14% CPU usage when decoding high bitrate Blu-ray movies.

  9. Oh, CPU usage is certainly lower when I am using hardware-assisted decoding. My GPU is simply not fast enough to decode Blu-ray-class content. That’s the only conclusion I can draw, since every hardware-decoding method I have tried has resulted in stuttery video and dropped frames. I have no doubt that if I had a better GPU, it would perform better than any software decoder I could run, as you say.

    If you have any other suggestions on how to get GPU-assisted decoding actually working for me, I’m all ears. Otherwise, I only know what I see, and I am seeing CoreAVC (and libavcodec, for that matter) outperform the GPU.

  10. There’s no reason your GPU isn’t fast enough to decode Blu-ray content. The Nvidia Ion IGP is weaker than the 8600M and I’ve seen people get great success even with the Geforce 8400 class GPUs, desktop and mobile. Remember, it’s the VP2/VP3 decoder unit that does the work.

    Are you running the latest Nvidia mobile drivers on your mobile GPU? I’m not sure if you’re using 32bit or 64bit Win7.
    Nvidia might be releasing newer mobile drivers soon though, they do it every quarter now.

  11. Yeah, I am running those drivers from NVIDIA’s web site on Windows 7 64-bit. (Windows 7 didn’t have any in-box drivers for my GPU.) I do keep an eye on the driver page and upgrade when new ones come out, so when an update is available, I’ll gladly check this performance again.

    On a slightly unrelated note, I do believe the drivers still need some tweaking for Windows 7, though… I’ve had some GPU-related issues resuming from standby, and it hasn’t obeyed my “turn off the screen after X minutes” setting since I installed Windows 7 (not sure if that could be a GPU-driver related issue or not). Oh, and it won’t let me use NVIDIA scaling on my display (after selecting the option and hitting “Apply”, it goes right back to “use my display’s scaling”).

  12. Hey Aaron,

    Here’s the new drivers.

  13. Hey, I’ve installed these but I haven’t had a chance to check and see if it improved h.264 performance yet. It did fix my screen powering off issue though. :-P

  14. in coreavc config file. Find the “deblocking” section (usually top right). change this to “skip always” (the last option).
    This will reduce your cpu usage upto 40% on a p4.
    With this option you can run 1080p mkv files on even a P4 (3.0 ghz or higher MUST have hyper threading and an 800mhz bus) in both vista and windows 7.

    Alternatively make a dual boot system by patition your hard drive and installing xp in drive d FIRST and then vista in drive c.
    XP reduces loat by 30% or more anyway.

    I still find coreave 1.9.5 to be the best codec.

  15. I have another question..

    another question…if you can answer. before when I had vista all the videos I downloaded all played widescreen. Now with windows 7, its not widescreen anymore. Even when I put the raito to be 16:9 it wont go widescreen.
    I use media player classic, or VLC. if you know how to put the widescreen back, please let me know.

  16. I haven’t had any such trouble with Windows 7. I am assuming that you are using a full-screen (4:3) monitor. In this case, make sure the screen resolution you have chosen for your desktop display is also 4:3. Other than that, I don’t know what would cause this problem in every media app you try.

  17. “However, I find that libavcodec is not fast enough to decode high-bitrate h.264 content in real-time on my machine (2.4 GHz Core 2 Duo)”

    Not really. That’s because by default only single-threaded decoding is enabled in CCCP. Your machine is perfectly capable of decoding 1080p content; you just need to enable multithreaded decoding under CCCP Settings (check the “MT” box next to the H.264 box). No need to futz around with alternatives.

  18. I had that enabled already, actually…
    If the bitrate is high enough (like that of a Blu-ray disc), 1080p content still does not play smoothly with libavcodec/ffdshow/CCCP. (Same story on Windows and Linux.)

    This is just on my laptop (which is my main personal machine), which has an Intel Core 2 Duo as I mentioned before. I tried it on a dual quad-core Xeon machine and it worked fine. :-)

    I’ve been meaning to make a follow-up post to this since a few things have happened, but I haven’t gotten to it yet, so I’ll briefly summarize here:

    * I’ve gotten DXVA to play back the high-bitrate h.264 at full speed. However, I have a few videos (not from Blu-ray) that DXVA seems to disagree with.
    * CoreAVC 2.0 is out, and while they fixed my decoding error, I find that it requires more CPU than 1.9.5, so videos don’t play smoothly anymore. A quick look at their forums reveals that I’m not the only one this happened to.

  19. Aaron, new WHQL drivers.

    Please also install the latest DirectX End-User Runtimes June 2010, it’s required for the latest MPC-HC builds.

  20. Hi, thanks for the update, but I get update notifications about both of these pieces of software now and I’ve already installed them both. (Just got the new drivers a couple hours ago.)

    Blog post about my new software notification system coming soon-ish (within the next month or so).

  21. Aaron, new WHQL drivers.

  22. Already got ’em, thanks.

    I’d also like to mention that recent NVIDIA drivers (starting around the 256 series) as well as CyberLink PowerDVD 10 is able to give me adequate performance for playing back high-bitrate h.264 content on my poor laptop. CoreAVC 2.0, while it fixes the issues described in this post, is slower than CoreAVC 1.x and does not provide adequate performance. Windows’s built-in DXVA-capable codec is still the second-best solution that I can find.

  23. Aaron,

    Thank you very much for this bit of information. I have been pulling my hair out trying to get some .264 to play and have tried many different codecs including the latest K-lite 9.90 and 9.95 but could only get it to work on Win7 32 but not Win764.
    I neve did get to work in Media Player Classic in the Win7 32 but now after adding your tip, it works.

    Thanks again.

  24. Looking to earn some extra cash or build up your wealth portfolio?
    In this Bitcoin Wealth Guide ebook collection there are numerous Bitcoin Wealth Guides you can use to generate bitcoin and cash.

Leave a Reply

Your email address will not be published. Required fields are marked *