Enable H.264 DXVA playback

With the right video card H264 decoding can be 100% offloaded from the CPU to the video card, so even those with not so powerful CPU's can watch HD movies without stuttering or frame loss. There are 2 types of DXVA support: full and partial, i will discuss further only about the full support (bitstream mode). There are also several methods to get DXVA to work, i'm going to describe the method i use. I got all this knowledge from a doom9 thread: Media Player Classic Home Cinema - DXVA!

Supported video cards :

* ATI Radeon HD, ATI HD3850/3870, AMD Hybrid CrossFireX 780G series for H.264 and VC-1
* Nvidia GeForce 8500, 8600, 9600 for H.264

Actually it should/could work with other cards also. You could simply check with DXVAChecker (click on the download button in the middle of the page), output should look like this:
http://i266.photobucket.com/albums/ii259/gngnmumu/dxva/th_Image1.jpg

If your OS is XP then you have to have Visual C++ 2005 SP1 and .NET Framework 2.0 installed for DXVAChecker.
If one of the lines says ModeH264_VLD your videocard is able of bitstreamdecoding and should work with MPC-HC. Direct 3D format of H264 shown by DXVAChecker must be NV12 or NV12/NV24. (Note to Laptop Nvidia users: if DXVAChecker shows Direct 3D format of H264 to be just NV24 then you have to install latest Nvidia drivers 178.24, but this will probably kill your HDMI-output at this time.)

Necessary rules for having DXVA: http://mpc-hc.sourceforge.net/DXVASupport.html . Please read it carefully. I'm not gonna copy it here, as i dont have any credits.

Necessary software :

- latest DirectX
- latest drivers for Nvidia (dont have Ati, so cant give any advice)
- Windows Media Player 11 or just the WMFormat 11 Runtime (codecs from VMP11) if you dont have them already installed.
- a codec-pack, like CCCP, (its not imperative to use CCCP, but cant give any advice on others.  dont forget to uninstall any other codec-pack if you are going to use this one).
- the DXVA capable player Media Player Classic Home Cinema. the link is for revision714 (you could also look on the site for the latest release). You will have to use this player for DXVA.
- CoreAVC for H264 decoding when the video file isnt DXVA compliant (there are encoding-rules to create DXVA compliant video files, but sadly not everybody is following them).

First: install directx, drivers.

This part about CCCP and CoreAVC isnt actually needed for DXVA, but it will give you a player that will play anything possible.
First install CCCP (like i said , its not imperative to use this codecpack, the idea is to have the necessary Haali-splitter for .mkv, ffdshow for prety much everything else and so on). After install, go to Start - All Programs - Combined Community Codec Pack - Filters - Ffdshow Video Decoder Configuration. Select codecs and right click anywhere on the window and set: Set all stable formats to libvacodec, but uncheck H.264/AVC:

http://i266.photobucket.com/albums/ii259/gngnmumu/dxva_tutorial/ffdshowvideo.jpg

Then Start - All Programs - Combined Community Codec Pack - Filters - Ffdshow Audio Decoder Configuration and do pretty much the same as above. If you dont want ffdshow to decode AC3, AAC, DTS because you use maybe AC3Filter then set those codecs to disabled. Also go to the Mixer tab and select your audio output (stereo, 5.1 ... )

http://i266.photobucket.com/albums/ii259/gngnmumu/dxva_tutorial/ffdshowaudio.jpg

Install CoreAVC. It's the fastest H.264 decoder , so in the case that DXVA doesnt work and decoding is sent to the CPU then the idea is to give decoding to CoreAVC (after setting up MPC-HC accordingly)

Download Media Player Classic Home Cinema (the standalone version, not the one with installer) and simply overwrite mplayer.exe from C:\Program Files\Combined Community Codec Pack\MPC. If you already have MediaPlayerClassic installed from another codecpack or standalone make a backup and overwrite it. If you want to use MPC-HC with all videofiles, or just for .mkv files set the preferences accordingly.



Now for the necesary settings of MPC-HC to have DXVA.

First go to View - Options and select the "Playback" Tab. Check "Autoload Subtitle Files":

http://i266.photobucket.com/albums/ii259/gngnmumu/dxva_tutorial/playback.jpg



Then in the "Output" Tab select "VMR9renderless" for XP and "EVR Custom Pres" for Vista.
For XP and VMR9 also select Surface: "3DSurfaces" and Resizer: "Bilinear PS2.0" and check "VMR9 Mixer Mode"
For Vista only select Resizer: "Bilinear PS2.0" (you can also try the other ones, but its the best i think)

http://i266.photobucket.com/albums/ii259/gngnmumu/dxva_tutorial/output.jpg



At the "Internal Filters" Tab check which file-type should be handled by the internal decoders(Transform filters) of MPC-HC. For Nvidia users: check only "H.264/AVC(DXVA)" and leave "H.264/AVC(FFmpeg)" and the two "VC-1"s unchecked. Ati users should uncheck only "H.264/AVC(FFmpeg)", as Ati cards support full VC-1 decoding with MPC-HC (Blu-Ray standard). Nvidia users must use the DXVA capabilities of Windows own decoders (im going to explain how later down).
It's also best to uncheck at the "Source Filters": avi, Matroska, MpegPS/Ts/PVA and leave those for the Haali-splitter, and also uncheck following "Transform filters": WMV1/2/3 to have DXVA of WMV9 with WMVDecoderDMO(Windows own WMV decoder). You could leave everything else checked, but it's up to you to uncheck them if you have another decoder for those specific file-types installed and want to use them.

http://i266.photobucket.com/albums/ii259/gngnmumu/dxva_tutorial/internalfilters.jpg



At the "External Filters" Tab click on "Add Filter" and add CoreAVC and DirectVobsub. Let CoreAVC with "Set Merit" that is set as default (so you are sure that MPC-HC will use CoreAVC if DXVA fails and not another H.264 filter that you may have installed). Directvobsub on the other hand set to: "Block". If Directvobsub loads then DXVA will not work!

http://i266.photobucket.com/albums/ii259/gngnmumu/dxva_tutorial/extfiltercoreavc.jpg
http://i266.photobucket.com/albums/ii259/gngnmumu/dxva_tutorial/blockvobsub.jpg


And lastly on the "Subtitles" - "Default Style" Tab set the character encoding of the subtitles you are going to watch. In my case i have "Easteurope" set to see the "diacritice" of the romanian language correctly. For english only users let it to "Default". Also check "Position Subtitles relatively to the video frame" or the subtitles dimension will not be correctly.

http://i266.photobucket.com/albums/ii259/gngnmumu/dxva_tutorial/subs.jpg


Now, there are some color problems with the Output VMR9 and EVR ("washed-out" colors), but the workarounds are different for Nvidia and for ATI.
If you have a Nvidiacard just select the "16-235->0-255" Shader:

http://i266.photobucket.com/albums/ii259/gngnmumu/dxva_tutorial/shader.jpg

As from the Nvidia drivers 178.24 you can use following option in the Nvidia Control Panel from the "Adjust Video color settings" and not the "16-235->0-255" Shaderfix:
http://i266.photobucket.com/albums/ii259/gngnmumu/dxva/th_pc.jpg


If you have a ATI card there is a registry-fix for it: "UseBT601CSC=1" registry fix with the utility at http://exdeus.home.comcast.net/ati-hd2x00/ . Dont ask me anything about it. I dont know.


For VC-1 and WMV9 DXVA decoding for Nvidia cards go to : Alex Zambelli's WMV Tools and download WMV9 PowerToy. Please read the necessary requirements and install if needed. Open WMV9 PowerToy and in the "Decoder" Tab check "DXVA WMV Support" and set to "ON". ATI users can do this to if they want DXVA decoding of WMV9.


If everything is set correctly then play a H.264 file and right click on the video screen. It should look like this:
http://i266.photobucket.com/albums/ii259/gngnmumu/dxva_tutorial/th_decoders.jpg

Select from there "MPC Video Decoder" and its property page will appear, showing you your videocard and the "DXVA Mode", if DXVA works it should say "H264 bitstream decoder":
http://i266.photobucket.com/albums/ii259/gngnmumu/dxva_tutorial/th_mpcdecoder.jpg

Another way to make a quick check is to press "Ctr+J" and the "Display Stats" appears:
http://i266.photobucket.com/albums/ii259/gngnmumu/dxva_tutorial/th_stats.jpg



Like i said, not every H264 file is DXVA compatible, sadly. But if you followed my advice about settings then in those cases MPC-HC will give up on the DXVA capable decoder and switch the decoding job to CoreAVC.
This is just one method for DXVA playback of H264. There are also commercial decoders capable of DXVA, but MPC-HC is the only free one.
Those with dual and quad cores that dont experience any problem when playing HD material dont have to use this. They dont even have to know what DXVA is (directx video acceleration).
Good luck with the tinkering.



Please share your comments and experiences on the comment area.

0 comments:

Post a Comment

 
© 2009 windows 8 download free Software | Powered by Blogger | Built on the Blogger Template Valid X/HTML (Just Home Page) | Design: Choen | PageNav: Abu Farhan