Enabling accelerated video decoding in Firefox on Ubuntu 21.04

Go to about:profiles and create a new Firefox profile. Then within that new profile (will be default settings for everything), follow this guide. The idea is to see what happens with default settings.

There is no need at all to reinstall Firefox, and you can remove the test profile later on easily.

For reference: https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles

Alright, created a profile and followed the guide but no luck.

Went to about:profiles > Create new profile > Entered name > Finish
Then for that new profile I clicked on Launch profile in new browser

ubuntu-restricted-extras is already installed as before.

Here are my changes to about:config
media.ffmpeg.vaapi.enabled : true (was false)
media.ffvpx.enabled : false (was true)
media.rdd-vpx.enabled: false (was true)
media.navigator.mediadatadecoder_vpx_enabled : true (was false)
gfx.webrender.all : true (was false)

about:support -

MOZ_LOG

$ MOZ_LOG="PlatformDecoderModule:5" firefox
[Child 13875: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in Content process
[Child 13875: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 13875: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
Gdk-Message: 18:36:01.668: Unable to load split_v from the cursor theme
[Child 13983: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in Content process
[Child 13983: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 13983: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 13983: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type

intel-gpu-top - 127/ 126 MHz; 77% RC6; 0.43 Watts; 158 irqs/s

  IMC reads:     2743 MiB/s
 IMC writes:     1089 MiB/s

      ENGINE      BUSY                                      MI_SEMA MI_WAIT
 Render/3D/0   18.10% |██████▎                            |      0%      0%
   Blitter/0    0.00% |                                   |      0%      0%
     Video/0    0.00% |                                   |      0%      0%

VideoEnhance/0 0.00% | | 0% 0%

1 Like

One last idea from browsing bugzilla, media.rdd-ffvpx.enabled to false (in addition to everything else). And/or maybe media.rdd-process.enabled to false again.

Nope.

$ MOZ_LOG="PlatformDecoderModule:5" firefox
[Child 3388: Main Thread]: D/PlatformDecoderModule PDMInitializer, Init PDMs in Content process
[Child 3388: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[Child 3388: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform

Filed 1735694

I should clarify that I can replicate the same issue on Firefox on Windows. I’ve only seen smooth hardware accelerated playback on Microsoft Edge. Haven’t tried Chrome on Windows yet on this system. On Ubuntu, nothing seems to work properly.

This always works for me:

  • Install VAAPI drivers.

  • Set the following flags:

media.ffmpeg.vaapi.enabled = true
media.rdd-process.enabled = false
media.av1.enabled = false

  • If you use Xorg

gfx.x11-egl.force-enabled = true

PD: VAAPI is broken on FF snap, .deb version works fine.

This is tracked by bug #1947115, and in the process of being fixed.

3 Likes

Thanks for your reply, I’ll keep an eye on it btw I’m already enjoying 21.10 on my main machine.

Sorry to slip a bit but on Intel Alder Lake , although vainfo shows AV1 support , I could not succeed to make Firefox decode it with GPU , did you try ?

Brilliant it worked for me first time! Previously I could not receive incoming videos in messenger, after the about: config changes it worked straight away. Thank you. I was going crazy trying to sort it.

@vchernin

https://www.phoronix.com/news/NVIDIA-VAAPI-Driver-0.0.8

Not sure if the above project is of any interest or use, i noticed it at phoronix yesterday.