Saturday, September 14, 2013

Intel Hardware Video Decoding on Linux! VDPAU, VA-API, and Flash!

My laptop has a Core 2 Duo 2.4ghz CPU with an integrated Intel video chipset (GM45). It plays flash fine, but I wondered if I could get some HW decoding like the ATI. Here goes:

Intel supports va-api, not vdpau (required by flash) I'm running Arch on my laptop, so it may require some modifications to use on other distros (or it may not work at all).

Requirements

  • xf86-video-intel
  • libva
  • libvdpau
  • libva-intel-driver (only does mpeg2)
  • libvdpau-va-gl

Optional

  • libva-driver-intel-g45-h264 - replaces libva-intel-driver (in the AUR, it does h.264 on specific chipsets, but may be worse than software decoding)
  • vainfo
  • vdpauinfo

Setup

After the required software is installed "vainfo" should return the supported decoders. vdpauinfo will return an error. Create a file (as root) /etc/profile.d/vdpau_vaapi.sh containing:

#!/bin/sh
export VDPAU_DRIVER=va_gl

Save and add execute permissions (chmod +x vdpau_vaapi.sh). Log off and back on or execute the export command above and vdpauinfo should return the supported codecs. Then modify /etc/adobe/mms.cfg and uncomment or add 

EnableLinuxHWVideoDecode=1

Next in chrome://flags enable 

Override software rendering list

Now it should work!

Notes:

  1. This works with flashplugin (11.2). I haven't played with it much, but it doesn't seem to work with pepper-flash (11.8). It has lower cpu usage than 11.2 with EnableLinuxHWVideoDecode commented out in /etc/adobe/mms.cfg, but uncommenting it has no effect. Either it's looking somewhere else for that config or it doesn't support it. 11.2 drops way below 11.8 with it enabled.
  2. Obviously different chipsets support different codecs, some may not support any at all. The VA-API Wiki page linked below has some info to that end.
  3. The Chrome flag may improve overall performance or it may break things / slow things down. you'll have to try it and see.
  4. You can check chrome://flash and chrome://gpu before and after to see what changes.

Links

No comments:

Post a Comment