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
 
vlc doesn't install any codec on your system. thats the best part of it.
it contains codec only for itself. no other player can take advantage or disadvantage of there codec. its makes no difference.
 
Altthough i've been using overlay mixture of media player classic and ffdshow, There's no possibility that hardware accleration or hardware performance is not getting used because the picture tells all ...

Ofcourse Cyberlink n others uses the hardware acceleration itself, but mediaplayer classic with overlay mixture turned..the x264 hdtv-fan type posts if you know what i mean looks freaky great on my 40 inch lcd. [it looks better than all those softwares available if ffdshow is configured well and post processing and little sharpness]

But I really appreciate the work you've shown here, its fantastic..people should know how to play when they download. [not copyright material ofcourse :p]

Digg done..

-Raghav
Cheers.
 
Hi.

Graphedit from the WinXP playback of a 720p stream attached... hope it helps.

Cheers!
usb101

2cy5wt1.jpg
 
guys have an unusual problem here. here's what i did :

1.installed powerdvd 8
2.copied and registered matroska splitter.
3.open the mkv files(all but one, a gladiator rip) open in windows media player..cpu usage : close to none! wow! in wmp when seeking theres a lag in video(it moves fast)
4.so i download MPC and try to open in it..but the cpu usage is again 60% around( the gladiator file does open in this)
also when playing the mkv videos now in media center(vista) if i open up the info menu by right clicking on the screen,menu is not smooth. it appears as frames in between, ie a flashing background along with a playing video.

uploaded the graphs from glad rip and batman 1080p rip
 
200mph said:
hehe i was joking re :cool2: , hehe , well i was going to get a lot of HD stuff this month end :D so a MEET is a must :D :D

And through all the post all I could see was this ^^^ :ashamed: Data Transfer Addict:D
 
@AK3D: You're right, of course. One does not need to uninstall all other codecs to get hardware acceleration to work... as long as one has the ability to define the priorities such that the 'preferred' codec is the one that's used. If you see the first few paras of the guide, I've stated clearly that neophytes would prefer to uninstall other codecs, while more experienced users know how to work around them.

I still feel, though, that uninstalling unnecessary codecs carries a very marginal penalty (in terms of lost flexibility), and for relatively new/ less knowledgeable users it may still be the simplest (not only; just simplest) way to go.

But you're right, in that the other way does exist, and it is a personal call exercised by the reader.

Cheers!

usb101
 
Hardware Acceleration in Vista x64

Hi, all. For those who have working installations of Vista (x64 is what I'm using, but I'm sure it works equally well in the 32-bit version), I have great news. Hardware acceleration works perfectly with very little effort.

You don't need PowerDVD/ WinDVD/ anything else. Just install MPC-HC v1.1.604.0 and the latest (full set) of graphics drivers, and hardware acceleration works.

I'm attaching some screenshots:

1. MPC-HC Options --> Output settings

25atfd5.jpg


2. MPC-HC Video Decoder DXVA selection (usually set by default)
You get this screen by Play --> Filters --> MPC Video Decoder (available during playback of the H.264 stream)

This screen shows that MPC-HC supports DirectX video acceleration out of the box.

2qivjtg.jpg


3. MPC-HC Enhanced Video Renderer - getting a DXVA stream
You get this screen from Play --> Filters --> Enhanced Video Renderer --> PinInfo tab.

As you can see from this image, the EVR is receiving a DXVA stream, so the hardware acceleration is being used.

2vbo48g.jpg


4. And the proof of the pudding... CPU utilization <10% using only free software. Go Vista! ;-)

339rl9z.jpg


I have a couple of more thoughts on this...
1. This should work in XP as well, since the version of MPC-HC in use is 32-bit (though the OS is Vista x64, just in case I caused some confusion). So theoretically, one could just install MPC-HC as done in the screenshots above and get hardware acceleration without having to install heavy and expensive software like PowerDVD and WinDVD. Still have to test this hypothesis, though.

2. Currently, my Vista output is better than my XP output... I have noticed pixelation and video corruption in a number of clips, sometimes marginal and sometimes significant. This corruption was not there when I re-played the clip through VLC, which means the source stream is accurate and the corruption is being introduced during the hardware decode. Current theory is that this is because of post-processing options I've selected in the drivers - antialiasing, super sampling, etc - which will have to be tested. But the Vista playback is perfect.

Some minor tweaking in XP should close this task... both installations are playing back 1080p H.264 streams with <10% system utilization, of which about 5% is from the AC3 decode so users with external sound cards that offload AC3 decode should actually see CPU utilization figures in the 0-2% range.

Cheers, people...
usb101
 
Actually, the instructions by you are well explained. For someone wanting to use DXVA, its a nice guide. I forgot to mention my appreciation for your hard work earlier on :).

Regarding the uninstallation, I pointed it out as unnecessary because its pretty 'easy' to get DXVA to work (again, provided you know what needs to be done).

Keep up the good work, looking forward to more of your inputs on TE.

usb101 said:
@AK3D: You're right, of course. One does not need to uninstall all other codecs to get hardware acceleration to work... as long as one has the ability to define the priorities such that the 'preferred' codec is the one that's used. If you see the first few paras of the guide, I've stated clearly that neophytes would prefer to uninstall other codecs, while more experienced users know how to work around them.

I still feel, though, that uninstalling unnecessary codecs carries a very marginal penalty (in terms of lost flexibility), and for relatively new/ less knowledgeable users it may still be the simplest (not only; just simplest) way to go.

But you're right, in that the other way does exist, and it is a personal call exercised by the reader.

Cheers!
usb101
 
i did the same steps as mentioned by usb101, but mpc shows this :

2hrimo3.jpg

usb101 said:
Hardware Acceleration in Vista x64

You don't need PowerDVD/ WinDVD/ anything else. Just install MPC-HC v1.1.604.0 and the latest (full set) of graphics drivers, and hardware acceleration works.

usb101
so i suppose its regarding the drivers. i downloaded the nvidia latest(178.13 whql) drivers this morning from their website. arent those the full set?
 
^^^you have to install .net framework 3.5 & select evr or evr custom pres. as output for dxva to work & not all h246/x264 videos available support dxva yet
 
Yesterday i did a fresh installation of Vista x64, downloaded and registered the latest Matroska Splitter for 64 bit, installed PowerDVD Ultra v8, used MPC-HC to run the 1080p videos and they were using ~60-90% CPU. Looked around and saw they were using ffdshow in the filters section. Unchecked that and then tried to play and the files were playing with audio but no video.

Ran the same file in Windows Media Player and they were running with the same 60-90% CPU usage.
I don't have any codecs installed except XviD, AC3.

As was suggested, tried to render a media file in GCCedit(don't remember the name exactly) and it said the necessary filters are not present.
The thing is if they are not present, how are they playing in Windows Media Player?

I have tried this method like so many times in both XP and Vista but i have not yet succeeded in doing it rite. If someone has done it correctly using Nvidia cards, plz help or advise any other method to resolve the HD playback issue.
 
AK3D said:
@clown abhi - try the link I posted earlier.

OK, I'll try that 2nite. BTW, How much should the CPU utilisation be while running a 1080p video on my range of processor. :huh: CoreAVC used to give me 20-30% in 720p and 60-90% in 1080p. As per ur guide 720p should be <10% and 1080p should be how much?

Also are all the 1080p mkv videos same?
 
@clown_abhi:

Re the questions raised:

1. CPU utilization is not affected between 720p and 1080p - in both, sys utilization is in the 5-7% range (if you're rendering AC3 sound through the processor) and the 0-3% range (if you have a dedicated sound card that offloads sound processing).

After some more trial and error in the past couple of days, I have been able to get hardware acceleration to work without PowerDVD. Only application being used is MPC-HC v1.1.604, available here:

SourceForge.net: Files

DXVA acceleration settings are explained here on their website:

http://mpc-hc.sourceforge.net/DXVASupport.html

I have followed the settings defined - EVR-custom in Vista x64, and VMR9 renderless for WinXP SP3. Confirm that both work as claimed; also confirm that if you use MPC v6.4.9.1 rather than MPC-HC 1.1.604, DXVA does NOT function. With the same system, I used MPC-HC instead of MPC 6.4.9.1, and DXVA started functioning.

To check whether DXVA is operational, you can play an MKV clip and go into Play --> Filters --> MPC Video Decoder. There is an option to 'Enable DXVA', and if DXVA is not being used, there is a label 'DXVA not in use'. If DXVA is being used, the label is 'H.264 bitstream decoder'.

Hope this helps...

Cheers!

usb101
 
Yea mate...it worked fine on my XP SP2 and Vista SP1.

Now utilization is around 1-5% (Earlier was around 24-40%) while HD playback.

But only problem is that it is not that smooth while seeking in player.

My Config: E2140 (at 2.8GHz) and EVGA 8800GT
 
Goldberg said:
Yea mate...it worked fine on my XP SP2 and Vista SP1.
Now utilization is around 1-5% (Earlier was around 24-40%) while HD playback.
But only problem is that it is not that smooth while seeking in player.

My Config: E2140 (at 2.8GHz) and EVGA 8800GT

I think seek is done by the proc, not by the GPU. It's slower... possibly. Haven't really timed it. But if you weigh the benefits of hardware acceleration against a slower seek, I think you'll go with the hardware accleration. ;-)

Glad to hear it's working for you, mate...

Cheers!
usb101
 
AK3D said:
@clown abhi - try the link I posted earlier.

Yohoo...Now all HD running at <5% CPU utilization after the steps mentioned in the link u posted.

Thanks a lot. Finally my HD woes are blown away. Thanks a lot to U. Repped. :clap:
 
Hey Guys,

I am back again with a query...:)

In MPC Home Cinema, the pictures are not as good as in Windows Media Player 11. Even Full HD movies lack the bright colours and good contrast that are present in the WMP11.
Normal AVI movies look far better on WMP11 than on MPC as well.

Even i could not find controls to change the saturation, contrast etc in MPC.

Does anyone else notice this?:huh:
 
Back
Top