Firefox from opensuse repo does not enable H264 hardware acceleration

Hello,

H264 videos, like this one https://x.com/SpaceX/status/2057952539417461045, aren’t playing smoothly on my Firefox 151.0.1 but on the same version from Flathub the H264 videos are playing smoothly.

I’m using OpenSUSE LEAP 16 on a Meteor Lake (Kernel 7.0.10-lp160.3.gbb95589 , Intel ARC driver i915, FFMPEG 7 from packman) and Firefox version 151.0.1 from the repository https://download.opensuse.org/repositories/mozilla/16.0/.

It appears that the OpenSUSE version does not enable H264 and HEVC hardware decoding (even with the default release profile) , while the Flathub version enable H264 and HEVC.

I see some differences :
OpenSUSE version use only
FFMPEG: version: 0x200, macro: 62, micro: 101

while the Flathub version use
FFMPEG: version: 0x100, macro: 61, micro: 101
FFMPEG: version: 0x200, macro: 62, micro: 101

OpenSUSE version:

MOZ_LOG=“PlatformDecoderModule:5” firefox -p
D/PlatformDecoderModule PDMInitializer, Init PDMs in RDD process
D/PlatformDecoderModule FFMPEG: version: 0x200, macro: 62, micro: 101, isFFMpeg: yes
D/PlatformDecoderModule Support AV_CODEC_ID_AV1 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_VP9 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_VP8 for hw decoding
D/PlatformDecoderModule No hw codec or decoder for AV_CODEC_ID_HEVC
D/PlatformDecoderModule No hw codec or decoder for AV_CODEC_ID_H264
D/PlatformDecoderModule FFMPEG: version: 0x200, macro: 62, micro: 101, isFFMpeg: yes
D/PlatformDecoderModule FFVPX: Link result: Success
D/PlatformDecoderModule Support AV_CODEC_ID_AV1 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_VP9 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_VP8 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_AV1 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_VP9 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_VP8 for hw decoding
D/PlatformDecoderModule PDMInitializer, RDD PDM order:
D/PlatformDecoderModule PDMInitializer, 0: FFmpeg(FFVPX)
D/PlatformDecoderModule PDMInitializer, 1: FFmpeg(OS library)
D/PlatformDecoderModule PDMInitializer, 2: Agnostic
D/PlatformDecoderModule FFmpeg decoder rejects requested type ‘video/avc’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/avc’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/avc’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/vp9’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/vp9’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/vp8’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/vp8’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/av1’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/av1’
D/PlatformDecoderModule FFmpeg decoder rejects requested type ‘video/hevc’
D/PlatformDecoderModule FFmpeg decoder rejects requested type ‘video/hevc’
D/PlatformDecoderModule Agnostic decoder rejects requested type ‘video/hevc’
D/PlatformDecoderModule FFmpeg decoder rejects requested type ‘audio/mp4a-latm’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/mp4a-latm’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/mp4a-latm’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/mpeg’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/mpeg’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/opus’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/opus’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/vorbis’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/vorbis’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/flac’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/flac’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/x-wav’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/x-wav’
D/PlatformDecoderModule Broadcast support from ‘RDD’, support=H264 SWDEC
VP9 SWDEC HWDEC
VP8 SWDEC HWDEC
AV1 SWDEC HWDEC
HEVC NONE
AAC SWDEC
MP3 SWDEC
Opus SWDEC
Vorbis SWDEC
FLAC SWDEC
Wave SWDEC

Flathub version:

MOZ_LOG=“PlatformDecoderModule:5” /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=firefox --file-forwarding org.mozilla.firefox
D/PlatformDecoderModule PDMInitializer, Init PDMs in RDD process
D/PlatformDecoderModule FFMPEG: version: 0x100, macro: 61, micro: 101, isFFMpeg: yes
D/PlatformDecoderModule Support AV_CODEC_ID_AV1 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_VP9 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_VP8 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_HEVC for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_H264 for hw decoding
D/PlatformDecoderModule FFMPEG: version: 0x200, macro: 62, micro: 101, isFFMpeg: yes
D/PlatformDecoderModule FFVPX: Link result: Success
D/PlatformDecoderModule Support AV_CODEC_ID_AV1 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_VP9 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_VP8 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_AV1 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_VP9 for hw decoding
D/PlatformDecoderModule Support AV_CODEC_ID_VP8 for hw decoding
D/PlatformDecoderModule PDMInitializer, RDD PDM order:
D/PlatformDecoderModule PDMInitializer, 0: FFmpeg(FFVPX)
D/PlatformDecoderModule PDMInitializer, 1: FFmpeg(OS library)
D/PlatformDecoderModule PDMInitializer, 2: Agnostic
D/PlatformDecoderModule FFmpeg decoder rejects requested type ‘video/avc’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/avc’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/avc’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/vp9’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/vp9’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/vp8’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/vp8’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/av1’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/av1’
D/PlatformDecoderModule FFmpeg decoder rejects requested type ‘video/hevc’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/hevc’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘video/hevc’
D/PlatformDecoderModule FFmpeg decoder rejects requested type ‘audio/mp4a-latm’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/mp4a-latm’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/mp4a-latm’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/mpeg’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/mpeg’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/opus’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/opus’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/vorbis’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/vorbis’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/flac’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/flac’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/x-wav’
D/PlatformDecoderModule FFmpeg decoder supports requested type ‘audio/x-wav’
D/PlatformDecoderModule Broadcast support from ‘RDD’, support=H264 SWDEC HWDEC
VP9 SWDEC HWDEC
VP8 SWDEC HWDEC
AV1 SWDEC HWDEC
HEVC SWDEC HWDEC
AAC SWDEC
MP3 SWDEC
Opus SWDEC
Vorbis SWDEC
FLAC SWDEC
Wave SWDEC

Any help ?

What does vainfo report?

In particular, does it list H264 and HEVC decode support?

If H264/HEVC are missing there, then the issue is lower in the VA-API/media-driver stack itself.

Perhaps also check sudo zypper se -si intel-media-driver libva

Hello,

thank you for your help

vainfo | grep -i h264
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice

sudo zypper se -si intel-media-driver libva
Chargement des données du dépôt…
Lecture des paquets installés…

S | Name | Type | Version | Arch | Repository
—±-------------------±-------±------------------±-------±---------------
i+ | intel-media-driver | paquet | 25.1.1-160000.2.2 | x86_64 | repo-oss (16.0)
i | libva-drm2 | paquet | 2.22.0-160000.3.2 | x86_64 | repo-oss (16.0)
i | libva-glx2 | paquet | 2.22.0-160000.3.2 | x86_64 | repo-oss (16.0)
i+ | libva-utils | paquet | 2.22.0-160000.3.2 | x86_64 | repo-oss (16.0)
i+ | libva-vdpau-driver | paquet | 0.7.4-bp160.1.11 | x86_64 | repo-oss (16.0)
i | libva-wayland2 | paquet | 2.22.0-160000.3.2 | x86_64 | repo-oss (16.0)
i | libva-x11-2 | paquet | 2.22.0-160000.3.2 | x86_64 | repo-oss (16.0)
i | libva2 | paquet | 2.22.0-160000.3.2 | x86_64 | repo-oss (16.0)
i | libvamp-hostsdk3 | paquet | 2.10.0-160000.2.2 | x86_64 | repo-oss (16.0)
i | Mesa-libva | paquet | 24.3.3-160000.3.1 | x86_64 | repo-oss (16.0)

Is the mozilla-openh264 package installed?

Hi,

thank you for helping

sudo zypper se -si mozilla-openh264

Chargement des données du dépôt…
Lecture des paquets installés…

S | Name | Type | Version | Arch | Repository
—±-----------------±-------±-------------------±-------±--------------------
i | mozilla-openh264 | paquet | 2.6.0-2.suse1600.2 | x86_64 | repo-openh264 (16.0)

For X/Twitter playback, the path is Firefox > ffmpeg > VA-API > Intel media driver

You could compare firefox about:support between the two. Specifically, the “Media” section showing “Codec Support Information”.

Strange the MOZ_LOG=“PlatformDecoderModule:5” firefox -p indicates no HW support for H264 only SW but about:support indicates HW and SW support

I’ve imported my current FF profile (copy and paste) in the Flathub version of FF and HW decoding works as expected.

So it’s not related to my drivers , my profile …

I will try to uninstall and reinstall of the OpenSUSE version

Interesting…
Personally I use this page to test video codec support. It tells you straight away if it’s supported by the browser, and if there is hardware acceleration it will show “Power Efficient: true”.
Then when playing videos, on my intel graphics I run sudo intel_gpu_top which shows if there is video decoding happening (third line “Video” in the ENGINES section).

How did you manage to get that detailed output?
In my case, the same command just starts Firefox but there is no output in the terminal window.

Try about:support (as URL) and look for media.

about:about tells you which other info-pages firefox provides.

2 Likes

Hello,
Try to create a second FF profile and the command should works

To investigate further, I created a new user account on the same PC, and here the OpenSUSE version of FF supports hardware decoding.

I suspect a HOME issue, or something similar in the PATH… to be continued.

1 Like

Thank you both.
That thread made me check the browser that I use, which is Zen browser, based on Firefox and installed for me as Flatpak. In the case of Zen, H264 hardware acceleration doesn’t kick in, I’ll try and figure out why…

There’s progress:

In KDE, I set usualy my display properties to a scaling of 150%.
Switching back to 100% made the SpaceX video playing smoothly again, even without hardware decoding.

I switched back to 150% and rebooted my LEAP 16, and the video is still smooth

Next step: hardware decoding.

@djm38fr Check out the permissions via flatseal for the flatpak application.

For me on flatpak, neither Firefox nor Zen are able to use vaapi. Looking at the basics, it doesn’t look good:

flatpak run org.freedesktop.Platform.VaInfo 
Trying display: wayland
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/intel-vaapi-driver/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva error: /usr/lib/x86_64-linux-gnu/dri/intel-vaapi-driver/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/intel-vaapi-driver/i965_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/nvidia-vaapi-driver/i965_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/GL/lib/dri/i965_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

Firefox as installed by Tumbleweed is able to activate vaapi, but the system supports it so there is consistency:

vainfo
Trying display: wayland
libva info: VA-API version 1.23.0
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_23
failed to open /usr/lib64/dri/hybrid_drv_video.so
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.23 (libva 2.23.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Sandybridge Mobile - 2.4.5
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc

Apologies, I realise I polluted this thread with my problem which I thought was related but is actually different.
In my case, VAAPI fails in flatpak because the i965 driver required for Intel Sandy bridge hardware has now been dropped from the flatpak runtimes… so, different situation to that of @djm38fr .
Thanks

Leap ships with Mesa without proprietary codecs enabled

I use OBS to have my own build of Mesa that flips the switch

Disregard my previous message, you just need Mesa from Packman repo, I don’t know why I was rolling out my own on OBS

Mesa from Packman still has a problem building for Leap. It’s only available for Tumbleweed and SLE http://packman.links2linux.de/package/mesa-drivers

Intel drivers offer H264 and H265 hardware video decoding out-of-the-box.

But radeon drivers do not.

So, @ugjka, your build of Mesa is the only thing that provides Mesa with hardware video decoding on Radeon cards. I’ve been using them, so please keep building them at least until Packman manages to fix their builds for Leap.

@djm38fr I can show Firefox from Tumbleweed on a laptop with Intel UHD Graphics 620, if it helps:


In Chromium: