The Firefox version for Fedora already has support for speeding up video decoding through VA-API

The Firefox package maintainer for Fedora announced that support is now ready to use hardware acceleration for video decoding Firefox in Fedora using the VA-API, since the acceleration until now only worked in environments based on Wayland, since the Chromium VA-API support was implemented in Fedora last year.

This added support of hardware acceleration of video decoding in Firefox was made possible by the new Wayland backend, which uses the DMABUF mechanism to draw textures and organize the exchange of buffers with these textures by different processes.

Yes, it is finally here. A year and a half after Tom Callaway, Engineering Manager @ Red Hat added the patch to Chromium, we also get hardware accelerated video playback for Firefox. It's a shame it took too long but I'm still learning.

VA-API support in Firefox is a bit specific, as it works in Wayland only at the moment. There is no technical reason for that, I just don't have enough time to implement it for X11, so error 1619523 is waiting for brave hackers.

Jonas Ådahl (Red Hat) helped me with the Wayland backend since the first Wayland patch four years ago.

In Fedora 32 and Fedora 31, the new version of Firefox 77 includes the new backend by default when running in the GNOME database session on Wayland, but to enable hardware accelerated video decoding certain additional packages are also required which must be installed on the system: ffmpeg, libva and libva-utils RPM Fusion repository, compiled with VA-API support.

On systems with Intel graphics cards, acceleration only works with libva-intel-driver driver (the libva-intel-hybrid-driver is not supported yet).

For AMD GPU, acceleration works if you have standard library radeonsi_drv_video.so, which is part of the mesa-dri-drivers package. For NVIDIA graphics cards, support has not yet been implemented. To evaluate compatibility with the VA-API driver, you can use the vainfo utility.

If support is confirmed, to enable acceleration in Firefox, on the "about: config" page, you must set the variables "gfx.webrender.enabled" and "widget.wayland-dmabuf-vaapi.enabled" to true.

After restarting the browser, you need to check the activation of WebRender and the new backend (Wayland / drm) on the page about: support.

After that, the user should make sure that the VA-API is used to speed up video display (there may be compatibility issues with codecs, video sizes, and libraries), for which debug mode can be enabled by starting Firefox with the MOZ_LOG environment variable and checking for the presence of «VA-API FFmpeg init successes.

MOZ_LOG = "PlatformDecoderModule: 5" MOZ_ENABLE_WAYLAND = 1 firefox

The use of acceleration when watching YouTube depends on the way the movie is encoded (H.264, AV1, etc.).

You can see the format in the right-click context menu in the "Statistics for Nerds" section. To select the format supported by the hardware video decoding system, you can use the enhanced h264ify plugin.

Separately, packages with Firefox 77.0 for Fedora include additional patches that affect performance and stability, which are absent in Mozilla's standard Firefox 77.0 builds. The inclusion of these patches in the main structure is expected only in Firefox 78.0 (users can use the beta version of Firefox 78 or the nightly builds from Mozilla by starting the browser with the command "MOZ_ENABLE_WAYLAND = 1 ./firefox").

Also, Mozilla builds They use the built-in libvpx library which does not support VA-API for VP8 / VP9 decoding; if acceleration is necessary of VP8 / VP9 decoding, libvpx must be disabled by setting the variable "media.ffvpx.enabled" in "about: config" false "(libvpx is already disabled in the package from the Fedora repository).

Finally, if you want to know more about it, you can consult the original note on the official website of Martin Stransky.

The link is this. 


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.