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 for using hardware acceleration for Firefox video decoding using the VA-API is now ready on Fedora , as acceleration has previously only worked in Wayland-based environments, since Chromium VA-API support was implemented on Fedora last year.

This added support for hardware acceleration of video decoding in Firefox was made possible by Wayland's new backend , which uses the DMABUF mechanism to draw textures and organize buffer swapping 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 the libva-intel-driver (the libva-intel-hybrid-driver is not yet supported).

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

If support is confirmed, to enable acceleration in Firefox, on the "about:config" page, the variables "gfx.webrender.enabled" and "widget.wayland-dmabuf-vaapi.enabled" must be set 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, it's noted that the Firefox 77.0 packages for Fedora include additional patches that affect performance and stability, which are absent from Mozilla's standard Firefox 77.0 builds. The inclusion of these patches in the main build is expected only in Firefox 78.0 (users can use the Firefox 78 beta or nightly builds from Mozilla by launching the browser with the command `MOZ_ENABLE_WAYLAND=1 ./firefox`).

Additionally, Mozilla builds use the built-in libvpx library which does not support VA-API for VP8/VP9 decoding; if VP8/VP9 decoding acceleration is required , libvpx must be disabled by setting the variable "media.ffvpx.enabled" to "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 article on Martin Stransky's official website.

The link is this. 


Add as preferred source in Google