It’s been a long journey since the first VA-API implementation in Firefox. Two years ago Firefox 77.0 come to Fedora with accelerated video playback on Wayland which was more a tech preview than a working solution.
Since then X11 support was added, fixed many bugs, AV1 decoding was implemented so we can claim VA-API code as mature enough to enable it for testing in Firefox Nightly 103. As we don’t want to scare peaceful Ubuntu users and grandmas watching their favorite show, VA-API is enabled in Nightly channel only and stock Firefox 103 won’t be shipped with that.
But ‘Real Men‘ wants more challenge. ‘Quiche Eaters’ can use polished software, LTS distros or even Mac. That’s nothing for adventurers running on the edge. Thus new Firefox updates (Fedora 35, Fedora 36) has VA-API enabled by default ahead of upstream to get what you asked for, brave Fedorans.
Along with a bunch of upstream VA-API backports I also added a fix for mozbz#1735929 to make life easier for those who did a life mistake with NVIDIA hardware. I hope you’ve got a lesson and your next card will be AMD.
And how to fruitify it? It’s embarrassing it doesn’t need any complicated, cryptic, powerful, unforgiving and dangerous edits of Firefox about:config preferences, setting env variables on terminal or midnight vows. If VA-API is configured property Firefox just takes it and claims at about:support page.
More details are available at https://fedoraproject.org/wiki/Firefox_Hardware_acceleration
11 thoughts on “Firefox with VA-API for brave Fedorans”
Should the flatpak builds have this too?
AFAIK it should involve Firefox from Fedora flatpak repo too.
How will this work for ubuntu (etc.) in the future? Will the Va-api packages be inside the snap/flatpak package? Or will it have some sort of dependency and installed during the installation of firefox?
Just interested how the “normal” user will get vaapi.
I hope Firefox 104 may enabled it by default if everything goes well. You need working VA-API environment for it which depends on your scenario. I’m not sure how VA-API is supported by snap/flatpak, that depends on actual distro or flatpak runtime.
Thanks for the article.
I am a non-Fedora user, but I use Firefox developer edition (currently on 102.0b9), I think I cannot have access yet to that experimental feature, am I reading it correctly?
Or is there a way for me to enable that? I think I have all the relevant packages installed, here’s the output of vainfo (using the Intel iHD driver for Intel(R) Gen Graphics v.22.4.2):
You can use it, you just need to set media.ffmpeg.vaapi.enabled to true and restart browser.
If it does not work please file a bug at bugzilla.mozilla.org,
See https://fedoraproject.org/wiki/Firefox_Hardware_acceleration#Troubleshooting for details how to proceed in case of troubles.
Hello Martin, I’m reaching you here because I saw you’re (one of the very few?) who works on Firefox for Linux.
Have you seen the regression that has occurred exactly since v.102?
reported and actively followed by users in Mint Mate:
was also reported here for the Solus distro:
Seems to affect much older machines. Like a few others in Linux Mint forum, I’m running Mate no 3D compositing, old Core 2 Duo, integrated G41 chipset GPU (ancient i915) Firefox at default tuneables, all hardware acceleration off, software rendering and am hitting the issue
I don’t see any VAAPI in about:support, neither in Nightly 109, nor in the Fedora build. Is it broken? It would be nice to have it upstream.
And another question: I’m curious what kind of Firefox patches Fedora is carrying. Is there some place I can read about these, or should I just look at the Fedora rpmspec?
See https://fedoraproject.org/wiki/Firefox_Hardware_acceleration for details, it was renamed to HARDWARE_VIDEO_DECODING to match Win/Mac version.
There’s the patch to enable VA-API by default:
LikeLiked by 1 person
Just for the record, this works also for brave “Ubuntuans”. 😉 Tested with Firefox 102.7.0esr on Kubuntu 22.04 LTS with FF from the Mozilla PPA because the FF snap variant is “not so nice”. :-P.
I can confirm that “MOZ_DISABLE_RDD_SANDBOX=1” is no longer necessary. In FF 102+ only “media.ffmpeg.vaapi.enabled = true” has to be set. That should be enough. And so far it looks great. Will try / test this during the next time a little more closely.
Many thanks @Martin Stransky for your great work in this matter!