1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

How to get hardware accelerated H264 playback (DXVA)

Discussion in 'General Software' started by Mussels, Sep 5, 2009.

  1. Mussels

    Mussels Moderprator Staff Member

    Joined:
    Oct 6, 2004
    Messages:
    42,489 (11.47/day)
    Thanks Received:
    9,768
    General information before we begin:

    Comparison screenshots for your own testing, and what to expect.

    1080P movie (Blu ray rip i made myself, so yes its a legal backup) using windows 7's codec and DXVA mode (see bottom of MPC-HC for evidence of this)
    If it matters to anyone, its a 12.3GB file - so its not low bitrate, or heavily compressed.

    [​IMG]
    You'll notice it has very low CPU usage - FYI, i'm going from 3-5% CPU usage with the show paused, due to background tasks (antivirus and such). so its very, VERY low.

    Now we try again with the *same codec* with DXVA disabled.
    [​IMG]

    GPU usage: 10% dropped to 2%
    CPU usage: 6% raised to 40% (varying in different scenes, but 35-40% was a clear average - you can see spikes in the usage graph as i seeked back and forth numerous times trying to get a good screenshot)

    Here is a screenshot of it working in windows media player. It NEEDS to be noted that for me to achieve this, i had to install the "DivX Technology preview" from their website - otherwise, i merely got FFDSHOW playing the files thanks to the CCCP codec pack i have installed, and only got software mode working.
    [​IMG]
     
    Last edited: Sep 5, 2009
  2. Mussels

    Mussels Moderprator Staff Member

    Joined:
    Oct 6, 2004
    Messages:
    42,489 (11.47/day)
    Thanks Received:
    9,768
    The old post is hidden behind here.

    Intended for a step by step guide on setup for ATI cards under windows 7.

    Getting it to work with Nvidia:
    Easy. Download CoreAVC and set it up to use Cuda. add it as an external filter/codec in MPC-HC and thats it. You can set nvidia up the same way as this, however the coreAVC solution appears to work better, so i suggest it for nvidia users.
    Nvidia clearly wins on this one for ease of use, but it took a third party program that costs money to do it properly. (see the ATI guide for how to set this codec up in MPC-HC)

    Getting it to work on ATI: here comes the fun :(


    Step 1:
    Uninstall any other packs, reboot. My guide will not cover other setups, and i will not help you with them.
    Download the latest version of CCCP
    Official (outdated at present)
    beta (Up to date - newer versions all the time)

    Step 2: some settings to tweak in MPC-HC (not always on by defauly, its been varying between betas)

    Keys tab: tick global media keys. Its to let those keys on your keyboard work - unrelated to hardware accel, but its useful.
    Misc tab: Tick OSD to show 'play' 'pause' and volume in the corner of the screen when you change them. I find it very handy to have on when using this on a media PC with a remote.
    Subtitles: if you have a weak CPU, you can lower the resolution for the subtitles. fast CPU? crank it up (desktop is reccomended by me) - it just makes them clear and crisp, even if the video isnt.

    Playback: Make sure "auto load subtitles" is enabled - unsure why, but DXVA will NOT work without it on.

    Output as below
    [​IMG]

    External filters:

    To add a codec, click "add filter" - merely select the codec and hit OK, and its all good.
    [​IMG]

    How mine looks
    [​IMG]
    Note the "preferred" radio button is ticked, after selecting the codec. if you forget that, you wont have done anything!

    Thats it really. Close MPC-HC and restart it, and you should be all good for DXVA mode.

    update: the new CCCP beta 2010-04-03.exe includes FFDSHOWs new DXVA support. Unlike 7's codec, this one falls back to software mode on incompatible files - giving you the best of both worlds.

    Simply set up the DXVA app in your start menu application as shown in these screenshots:

    [​IMG]

    [​IMG]

    [​IMG]

    Then so long as MPC-HC is using FFDSHOW (default) you're gunna get DXVA running :)
     
    Last edited: Apr 5, 2010
    Boyfriend, Cold Storm and psyko12 say thanks.
  3. Mussels

    Mussels Moderprator Staff Member

    Joined:
    Oct 6, 2004
    Messages:
    42,489 (11.47/day)
    Thanks Received:
    9,768
    Placeholder post 3
    list of known problems, and workarounds/solutions.

    people can post now, but no need - there aint much to see yet :p


    Nvidia:
    CoreAVC with Cuda support enabled doesnt support files with 16 reference frames (which is one method to get better file quality at the expense of encoding time) or greater. It also doesnt like interlaced streams (Such as from a TV tuner) - the current version of CoreAVC is 1.9.5 and it has these issues, they should be fixed in a later version.

    ATI:
    Some files corrupt/dont play. I dont know why, but i can link to an example file for others to diagnose.
    In order to disable DXVA yet use the same codec, all i'm doing is changing the rendering path to VMR9 instead of EVR custom. EVR custom doesnt corrupt when used with FFDSHOW or CoreAVC, so its the windows 7 codec or ATI's drivers at fault here.

    Example with DXVA off:
    [​IMG]
    Example with DXVA on:
    [​IMG]

    Pretty easy to tell which ones not working right :p

    Without an Nvidia card to test with, i cant tell if the problem is with windows 7 or ATI's drivers, but at this stage i beleive it to be ATI's drivers.

    edit: the files above turned out to just be DXVA incompatible. Nvidias solution (and now with some update ATI drivers) DXVA just disables and drops to software mode on those files.


    Edit: this no longer happens on ATI cards, they've updated the drivers so that it now plays corruption free, even on out of spec H264 files.
     
    Last edited: Oct 5, 2010
    Cold Storm says thanks.
  4. Zubasa

    Zubasa

    Joined:
    Oct 1, 2006
    Messages:
    3,980 (1.34/day)
    Thanks Received:
    457
    Location:
    Hong Kong
    You have to consider that both of our card's gpus are clock at 500Mhz in UVD, and that HD decoding is not really memory intensive compare to games. (Explaining that the difference in memory bandwidth is non-existant.)
    Decoding HD content is a walk in the park for both of our cards and that I was watching a 720p anime. (So the GPUs are in UVD state 1 which is 500Mhz)

    Given that Avivo post-processing only takes around 1~2% of GPU load,
    a constant 7% load on my 4850 should be an indication that I got DXVA in WMP, its around the same for MPC-HC.
     
    Last edited: Sep 5, 2009
  5. Wile E

    Wile E Power User

    Joined:
    Oct 1, 2006
    Messages:
    24,324 (8.16/day)
    Thanks Received:
    3,778
    CCCP needs to update to support this out of the box in WMP and WMC. I tried Sharky's Win7 Codec pack as well at some point, but I didn't like it as much. It didn't work as well with ps3 Media Server.
     
  6. Mussels

    Mussels Moderprator Staff Member

    Joined:
    Oct 6, 2004
    Messages:
    42,489 (11.47/day)
    Thanks Received:
    9,768
    CPU usage is a better indicator than GPU usage, since i get GPU usage even with DXVA disabled - we're talking a 3D OS, and even without acceleration the EVR rendering path is still rendering in 3D (this is clearly labelled in MPC-HC)
    [​IMG]
    Note the "3D surfaces"

    The latest betas do, once you add 7's codec as a priority. while many people know how to do that, steps will be in post 2 when my pizza finishes being eaten.
    edit: done
     
    Last edited: Sep 5, 2009
  7. wiak

    wiak

    Joined:
    Sep 5, 2004
    Messages:
    1,747 (0.47/day)
    Thanks Received:
    200
    Location:
    Norway
    the encoded file must be level 4.1 to get DXVA to work on any card, its pointless to encode to level 5.1 when not even dedicated hardware can decode it, like Popcorn Hour etc

    btw reference frames is a limitation of dxva, the higher the ref frames the non complaint dxva encode it will be

    just use the built in h264/dxva decoder in mpc-hc
     
    Mussels says thanks.
  8. Mussels

    Mussels Moderprator Staff Member

    Joined:
    Oct 6, 2004
    Messages:
    42,489 (11.47/day)
    Thanks Received:
    9,768
    i dont know the level stuff, but i've heard the 4.1 number bandied about - how can you tell what level a file was encoded with?
     
  9. wiak

    wiak

    Joined:
    Sep 5, 2004
    Messages:
    1,747 (0.47/day)
    Thanks Received:
    200
    Location:
    Norway
    Mussels says thanks.
  10. wiak

    wiak

    Joined:
    Sep 5, 2004
    Messages:
    1,747 (0.47/day)
    Thanks Received:
    200
    Location:
    Norway
    if your files displays corrupt just use software decode ;)
    btw most 720p x264/h264 encodes are level 4.1 now
     
  11. Mussels

    Mussels Moderprator Staff Member

    Joined:
    Oct 6, 2004
    Messages:
    42,489 (11.47/day)
    Thanks Received:
    9,768
    indeed, the problem is that there is no automated way to do it - so i have to use two different players, or swap back and forth between the settings. (my media PC struggles on 1080P sometimes without DXVA)
     
  12. wiak

    wiak

    Joined:
    Sep 5, 2004
    Messages:
    1,747 (0.47/day)
    Thanks Received:
    200
    Location:
    Norway
    same here bro, hehe my media pc is a X2 5000+@2ghz, 2GB, Radeon HD 3200
    i can play blu-ray at upto 1080p/40mbit, but i cant even play some 1080p files why? the guys that encode are not looking at the big picture, and dont care if it cant be decoded on slower pcs
     
  13. wiak

    wiak

    Joined:
    Sep 5, 2004
    Messages:
    1,747 (0.47/day)
    Thanks Received:
    200
    Location:
    Norway
    btw have you tried CoreAVC? and check cpu usage?
    sometimes CoreAVC will decode realy well
     
  14. Mussels

    Mussels Moderprator Staff Member

    Joined:
    Oct 6, 2004
    Messages:
    42,489 (11.47/day)
    Thanks Received:
    9,768
    the files that were corrupting on me are encoded to level 5.0, and did not work even when changed back to 4.1 via the tools linked by wiak.

    It seems windows media player is smart enough to automatically change codecs for those files, but MPC-HC isnt.

    i mention coreAVC early on :p it just doesnt get hardware accel on ATI.

    on my media PC, FFDSHOW cant do 1080P smoothly, while CoreAVC can - (60-80% CPU) whereas 7's built in codec (on properly encoded files) gets that to <10% - being borderline for lag free aint good when you have housemates leeching files off the PC over the network, and so on.
     
  15. wiak

    wiak

    Joined:
    Sep 5, 2004
    Messages:
    1,747 (0.47/day)
    Thanks Received:
    200
    Location:
    Norway
    CoreAVC CUDA is fake, it just uses DXVA hehe, i have heard
     
  16. Wile E

    Wile E Power User

    Joined:
    Oct 1, 2006
    Messages:
    24,324 (8.16/day)
    Thanks Received:
    3,778
    I can get it to work in both Zoom and MPC-HC, but I need it to work in Windows Media Player/Media Center, or I need a Media Center replacement that uses the necessary rendering paths. MPC doesn't cut it.
     
  17. Mussels

    Mussels Moderprator Staff Member

    Joined:
    Oct 6, 2004
    Messages:
    42,489 (11.47/day)
    Thanks Received:
    9,768
    it gets lower CPU usage than DXVA, support varied based on nvidia drivers (you needed a certain driver or up, in which nvidia stated in the release notes they added more CUDA support), and it has a different set of bugs than DXVA mode on nvidia cards.


    Just because both modes are hardware accelerated, doesnt mean they're both DXVA.
     
  18. Mussels

    Mussels Moderprator Staff Member

    Joined:
    Oct 6, 2004
    Messages:
    42,489 (11.47/day)
    Thanks Received:
    9,768
    then you need the divX thing i linked to, which adds WMF MKV support into WMP.
     
  19. Wile E

    Wile E Power User

    Joined:
    Oct 1, 2006
    Messages:
    24,324 (8.16/day)
    Thanks Received:
    3,778
    Does it screw with Haali subtitle settings? I might have to try it.
     
  20. Mussels

    Mussels Moderprator Staff Member

    Joined:
    Oct 6, 2004
    Messages:
    42,489 (11.47/day)
    Thanks Received:
    9,768
    dont beleive so. they have a heap of patch notes saying it only works with one audio track and 'doesnt support subtitles' but i watched anime with softsubs and it played fine (albeit, the anime only has one audio and one subtitle track)
     
  21. wolf2009 Guest

    use mediainfo or Shift+F10 in latest builds of MPC-HC, and click on mediainfo tab.

    also, you don't need to use Core AVC for Nvidia cards, just check the matroska filter and H.264 DXVA in internal filters and DXVA should be good.
     
  22. Wile E

    Wile E Power User

    Joined:
    Oct 1, 2006
    Messages:
    24,324 (8.16/day)
    Thanks Received:
    3,778
    I hate to be so picky, it's just that while I'm not hooked directly to the TV, I need my subs and audio tracks preconfigured by Haali so that I can stream to the ps3, but then I need this stuff to work in Media Center as well, for when I am hooked to the TV.
     
  23. Mussels

    Mussels Moderprator Staff Member

    Joined:
    Oct 6, 2004
    Messages:
    42,489 (11.47/day)
    Thanks Received:
    9,768
    indeed you dont need to, but its a lot better.

    MPC-HC's internal H264 decoder is terrible, and barely works on most files. If the files encoded with a high bitrate its software decode isnt going to work at all - its higher than FFDSHOW. At least the other codecs have a chance to play in software mode if hardware mode fails.
     
  24. Mussels

    Mussels Moderprator Staff Member

    Joined:
    Oct 6, 2004
    Messages:
    42,489 (11.47/day)
    Thanks Received:
    9,768

    Go to the link, signup, and post in their forum. They;re on beta 3 atm, and if you voice your concerns it may end up in beta 4. It aint ever gunna work any way except with DivX help, so you really should go nag them about it before its too late and they make it final.
     
  25. Wile E

    Wile E Power User

    Joined:
    Oct 1, 2006
    Messages:
    24,324 (8.16/day)
    Thanks Received:
    3,778
    Yeah, but their internal DXVA codec does great. You can enable one without the other.
     

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page