User Guides HowTo: Hardware decode H.264 streams (MKV)

Hardware acceleration of H.264 streams in MKV containers

With the arrival of nVidia G92 architectures (8400/ 8500/ 8600/ 9xxx models, to name a few of the most popular cards), a lot of us became aware that cheap hardware acceleration of HD streams was now feasible. Some of us (which included me till very recently) may even believe that 'it just works', based on the many advertisements and sometimes incomplete information spread by the manufacturers.

How do you know whether hardware acceleration is working for you? You know because there's no in-between CPU utilization if you've got hardware acceleration functional on your system. If your machine is rendering HD in software, you'll see CPU utilizations anywhere between 30% and 100%, depending upon your machine and codec; if you have hardware rendering, you'll normally be at less than 10%. To illustrate, my CPU utilization on a C2D E6400 stock-clock came down from 90% while rendering a 720p movie to ~5%. I uninstalled my sound drivers, and CPU utilization was... zero! I'm not joking. It's amazing to watch a 720p video stream play silently while the Task Manager tells you CPU utilization is zero. With sound drivers and a fully functional system, ~5% is pretty normal, and this doesn't go up if you play a 1080p stream instead. So stable CPU utilization >30% (or even 20% on a high-end machine) is usually a good indicator of software-based rendering.

What are the facts? The facts are:
1. nVidia and ATi have introduced cards that permit hardware acceleration (nVidia through PureVideo and ATi through the AVIVO implementation);
2. These features are exposed to software players by way of DirectX acceleration (DXVA) implemented in the graphics drivers (read: no need to buy something extra from the manufacturer)
3. However - and this is the critical issue - the player must support DXVA acceleration to be able to make use of this functionality. Also, the primary codec the system defaults to should be one that works with hardware acceleration. If one has a software renderer like FFDShow or CoreAVC as primary, the hardware acceleration will not function.
4. This problem is usually limited to MKV playback, since if you've got WinDVD/ PowerDVD installed on your machine, they are able to recognize any HDDVD or Blu-Ray disc you may have inserted, and are able to use the right codec to permit hardware acceleration. The problem with MKV comes from the fact that these software don't recognize MKV containers and therefore don't accelerate the H.264 stream that emerges from it.

So, which players permit DXVA acceleration? Based on what I've done, PowerDVD 8 Ultra definitely works, and from what I read, WinDVD 9 should work, too. Other than that, you'll need to do some reading - the player will clearly state support for either/ and PureVideo and AVIVO.

Note - this doesn't mean one has to use that player; if you prefer Media Player Classic or ZoomPlayer, you can use that for regular playback, as long as you've got the PowerDVD/ WinDVD software installed. Since most popular players (MPC etc) are DirectShow based, they can use the highest priority codec (eg, the PowerDVD hardware accelerated codec) once it's been installed and set up right.

Having got all the conceptual stuff out of the way, let's get to the how-to part. The process stated below is the one suitable for most neophytes; advanced users who understand what they're doing need not uninstall the software renderers, and can reduce them in priority or block them out from the player instead. I assume you already have your latest graphics drivers installed.

Steps:
1. Uninstall all the codec packs (KLite, CCCP, to name two of the most popular).
2. Uninstall any implementation of FFDShow or CoreAVC that may be installed.
3. Try playing an MKV or other HD file... if you've done this right, it shouldn't play. ;-)
4. Install the player of choice (WinDVD or PowerDVD or whatever else you've identified for yourself).
5. Download MatroskaSplitter from SourceForge.net: Files
This is version 1.0.2.9, which is currently the latest. A newer version may be available by the time you read this.
6. The download will be a file with the .ax extension. Copy it to c:\windows\system32 (or wherever your Windows\system32 folder is located), open up a command line, and type: regsvr32 matroskasplitter.ax <Enter>. This will register the filter, and make it available for use to the system.
7. Download Media Player Classic Home Cinema ed 1.1.604 (this is my favourite; feel free to use any other player you like) from http://mpc-hc.sourceforge.net/
8. Right-click the file you want to play and associate it with the player of your choice.

You may need to re-install AC3Filter (AC3Filter) if you have a problem with the sound after uninstalling the codec packs, but that should fix everything.

Hope you find this useful... cheers and best wishes!
usb101

PS: Thanks to RpOk for getting me started on TechEnclave and putting me onto a lot of the stuff you see in this post.
PPS: My first post, so forgive errors and suggest improvements - I'm a reasonably fast learner. :D
 
Really good guide.But is there any improvement in picture quality with hardware decode?? I mean i have a 8600gt in my computer but why use it when my cpu can handle all the load ?? both 720p and 1080p play flawlessly so is there any advantage moving to hw decoding of H.264 streams ??
 
coolraghav said:
have you selected the round Overlay mixture in MPC options ? if not then do it !

Selecting Overlay or EVR does not change the picture quality. It's the same dull picture compared to the vibrant picture quality in Windows media Player.
Does anyone has a workaround to make the video look same as WMP11?
 
Anyone knows how to make DXVA work in KMPlayer. A step to step guide will help a lot. Saw a lot of resource on the web but can't get it to work :(
 
@usb101 - followed your guide, system in sig. Seeing 3-5% utilisation on 720p rips, but 1080p rips are running at ~30%. DXVA is showing "not in use".. Vista x64. Followed your steps correctly.. what else should I be doing?
EDIT: weird! Works on 720p rips, but 1080p rips show DXVA to be non-functioning. Help??
 
I think its more to do so with the profiles used for certain rips. It may difer i guess, however i am not seeing 3-5~ ever. More so like 30% as usb himself has experienced. I think it may be the movie rips again.
 
Use the attached utility to check the profile of your mkv and avi files. It should be 3.1 for SD and 4.1 for HD for dxva to work. Most 1080p rips however are encoded at L5.1, hence don't support dxva.

Edit: Credits go to avsforum :)
 

Attachments

  • IDC Changerv0.2.zip
    9.2 KB · Views: 212
zhopudey said:
Use the attached utility to check the profile of your mkv and avi files. It should be 3.1 for SD and 4.1 for HD for dxva to work. Most 1080p rips however are encoded at L5.1, hence don't support dxva.

Edit: Credits go to avsforum :)

Only works for 720 p and lower :)
 
thanks. nice guide. good effort there. my cpu usage has come down to <10% from >40% earlier. i'm on a 8400gs card on a dell vostro laptop. the files run more smoothly now.
 
well frankly all you need is to install MatroskaSplitter and MPC-HC(latest version) to get your GPU decode H.264 streams.But honestly sw based solutions are better than hw based......less jerky playback.
 
well, though the playback is smooth..subtitles get delayed/desynched while playing any kind of file maybe coz of frame drops. any idea how to correct the subtile delay problem...?
 
Well it is working but I didn't find any noticeable difference between KMP's older standard output and PowerDVD's new codec output.
If someone makes it more clearer the use of this feature that'll be really helpful.
 
imho there is a link in this same thread that shows you how to do it without the external codecs like power dvd etc. I got my usage down to 0~4 % while playing dxva profiled movies following the same guide.

:)
 
Back
Top