In case anyone didn't know, Firefox now finally supports (>v80) hardware video acceleration/decoding on the web, including YouTube etc. This is VAAPI only for now, and works on both Wayland and X11 - though I've found the latter far more useful. As it's X11 support, this works on basically all Linux distros as well as *BSD and it's been flawless for me. I have finally been able to ditch janky ungoogled-chromium installs (patched for VAAPI) and just use the built in Firefox packages with no messing. Win! Tested on Debian Buster and Bullseye, Arch, Fedora 32 and 33, and FreeBSD.
Steps to activate:
1) Firefox needs launching with MOZ_X11_EGL=1 and you can do this either with the launcher, or set it as an environmental variable in /etc/environment or .bashrc/.zshrc/whatever (export MOZ_X11_EGL=1).
2) Change the following preferences in about:config
3) Install h264ify or enhanced-h264ify as the acceleration is x264-only at the moment. The former addon works on all sites including embedded videos. The latter only works on YouTube but does allow disabling of volume normalisation and allows you to choose which codecs to allow/disable. Swings and roundabouts.
You will need to have the appropriate hardware drivers for your platform (eg i965 for Intel iGPU, amdgpu+mesa for AMD) as well as the libva and vaapi packages for your platform (libva, libva-intel-driver or similar depending on your hardware). You can test that you're set with vainfo - the package is either called vainfo or libva-utils depending on distro/platform. If vainfo gives a non-error output (i.e. a list of codecs it can decode and encode) you're set.
You can test that it's working by launching Firefox with MOZ_LOG="PlatformDecoderModule:5" - for example by running MOZ_LOG="PlatformDecoderModule:5" firefox in a terminal. While this does restrict you to x264 (and thus 1080p) on YouTube, it's great for low powered laptops etc running on battery (not so much on my Threadripper desktop system, but meh). YMMV but it's pretty easy to get working and the Arch Wiki has some distro-agnostic info if you get stuck.
Steps to activate:
1) Firefox needs launching with MOZ_X11_EGL=1 and you can do this either with the launcher, or set it as an environmental variable in /etc/environment or .bashrc/.zshrc/whatever (export MOZ_X11_EGL=1).
2) Change the following preferences in about:config
Code:
gfx.webrender.all:true
media.ffmpeg.dmabuf-textures.enabled:true
media.ffmpeg.vaapi.enabled:true
media.ffvpx.enabled:false
3) Install h264ify or enhanced-h264ify as the acceleration is x264-only at the moment. The former addon works on all sites including embedded videos. The latter only works on YouTube but does allow disabling of volume normalisation and allows you to choose which codecs to allow/disable. Swings and roundabouts.
You will need to have the appropriate hardware drivers for your platform (eg i965 for Intel iGPU, amdgpu+mesa for AMD) as well as the libva and vaapi packages for your platform (libva, libva-intel-driver or similar depending on your hardware). You can test that you're set with vainfo - the package is either called vainfo or libva-utils depending on distro/platform. If vainfo gives a non-error output (i.e. a list of codecs it can decode and encode) you're set.
You can test that it's working by launching Firefox with MOZ_LOG="PlatformDecoderModule:5" - for example by running MOZ_LOG="PlatformDecoderModule:5" firefox in a terminal. While this does restrict you to x264 (and thus 1080p) on YouTube, it's great for low powered laptops etc running on battery (not so much on my Threadripper desktop system, but meh). YMMV but it's pretty easy to get working and the Arch Wiki has some distro-agnostic info if you get stuck.
Last edited: