HW x264 decoding In Firefox 116

thought, v4l2 codes merge into vaapi module, so can not found ‘media.ffmpeg.v4l2(m2m).enabled’.
so, just flag ‘true’ to ‘media.ffmpeg.vaapi.enabled’.
am i right?

Hi @Rip2, Successful in getting Firefox-116 to have vpu hw acceleration?

don’t think so, play YT cpu loading average 50%.

Similar experience on Jammy with Firefox-116.0.1 and ffmpe-4.4.2-0ubuntu0.22.04.1 – no vpu hw acceleration.

Am assuming ffmpeg-4.4.2-0ubuntu0.22.04.1 has “v4l2m” enabled as this ffmpeg with mpv-0.34.1-1ubuntu3 support vpu hardware acceleration eventhough it is not as good as “mpv-hwdec” by @spikerguy.

1 Like

@JFL, some guy said, firefox-117.0b1-1 HW work, you might try.

sudo snap install firefox --beta

firefox 106 by default has hw h264 enabled but videos don’t get started (about:support)

H264_HW_DECODE	default	available	
Multimédia
Backend audio	pulse-rust
Nombre maximum de canaux	2
Fréquence d’échantillonnage préférée	48000
Latence aller-retour (écart type)	144.35ms (102.41)
Informations sur la prise en charge des codecs	
Nom du codec	          Décodage logiciel	Décodage matériel
H264	                    Pris en charge	Pris en charge
VP8	                        Pris en charge	Non pris en charge
VP9	                        Pris en charge	Non pris en charge
AV1	                        Pris en charge	Non pris en charge
Theora	                    Pris en charge	Non pris en charge
AAC	                        Pris en charge	Non pris en charge
FLAC	                    Pris en charge	Non pris en charge
MP3	                        Pris en charge	Non pris en charge
Opus	                    Pris en charge	Non pris en charge
Vorbis	                    Pris en charge	Non pris en charge
Wave	                    Pris en charge	Non pris en charge

The problem must be the same as https://forum.manjaro.org/t/mpv-0-36-how-to-setup/144958/27

what is this error means?
libva error: /usr/libdri/v4l2_request_drv_video.so init failed

Hi @Rip2, Thanks for the info on snap firefox --beta. Using Firefox “deb” verison 116.0.1+build1-0ubuntu0.22.04.1~mt1 or version for Lunar from ppa:mozillateam/ppa.

Will look forward to Firefox 117 to try it out. Question will be, is enhance-h264ify required? Typically Youtube default video stream is “vp09”.

I installed this mourning on my pi400 and it actually hit a nerve in about:config. I can not say with 100% certainty but looking at htop the cpu’s usage appear to be lower. Playing the link below with 116 the cpu’s were in the 80’s to high 90’s. With 117-beta they were in the 50’s to 70’s. I do not know how much the cpu usage is supposed to decrease but remembering back with MMAL on a 32bit OS it was a higher layer doing HW than the omxplayer using direct HW at the hardware layer. But the kodi-rpi program does cut way back further using HW v4l2 and v4lm2m; but it will not do HW within a DE.

https://youtu.be/L-Tts8MkE-w

At this time I do not know how the firefox-beta is installed; whether or not it is using my installed ffmpeg-v4l2-request-git with v4l2mem2m support.

about:config using 117-beta snap with v2l/v4l2m2m finally showing up. I removed ~.mozillia directory so it could create it’s own configs first before running the firefox snap:

Updated:

Well I have disappointed my self. It seems that my 116 config’s (~/.mozilla) was copied over in the background to /home/ray/snap/firefox/common/.mozilla. So after deleting /home/ray/snap/firefox/common/.mozilla it will not play .mp4 video. All I get is a blurry pic with sound. :rage:

The only good thing so far is v4l/v4lm2m lines are now showing up in about:config with 117-beta.

btw, best browser for Pi4 is PiOS’s chromium.

  • Canvas: Hardware accelerated
  • Canvas out-of-process rasterization: Enabled
  • Direct Rendering Display Compositor: Disabled
  • Compositing: Hardware accelerated
  • Multiple Raster Threads: Enabled
  • OpenGL: Enabled
  • Rasterization: Hardware accelerated
  • Raw Draw: Enabled
  • Video Decode: Hardware accelerated
  • Video Encode: Software only. Hardware acceleration disabled
  • Vulkan: Disabled
  • WebGL: Hardware accelerated
  • WebGL2: Hardware accelerated
  • WebGPU: Disabled

Hi @Darksky & @Rip2,

firefox_117.0~b4+build2-0ubuntu0.22.04.1_arm64.deb doesn’t seem to have the “v4l”, v4l2, v4l2m2m or v4l2mem2mem. I suppose is different from the “snap firefox --beta”.

To tell you the truth I am not sure where the issue lies. I tried to mess with the 117 snap some more trying different ffmpeg’s and now I can not seem to get the v4l stuff to show up again no matter what I do. I even posted on the mozilla forums for help and for days every time I checked there were 3 users on line. Me and Google and Bing bots so no one seems to want to help there and no help online.

Hi @Darksky,

Happen to bump into this Mainline VPU ffmpeg-7:6.0-2+v4l2request1. Mainline v4l2-request VPU support for many ARM socs.
Mainline VPU : JianFeng Liu.

Not sure it will be of any help.

@JFL Here is the ffmpeg that v4l showed up at one time with 117 snap if you want to see what happens there. No clue if you have to uninstall your 4.4 or not.

https://drive.google.com/file/d/1og-z9FFyX867ajNt-4tvaP0DfNSnxWv-/view?usp=sharing

Thanks. I am not that well verse in how to get the ffmpeg-v4l2-request-git-2 6.0.r329749-2-aarch64.pkg.tar.zst to load/install on Jammy.

Limited skill set.

Probably would not work on jammy if you did get it installed. Looks like their packages are older.

@Darksky, in ffmpeg-v4l2-request’ s PKGBUILD, ```
–enable-v4l2_m2m not --enable-v4l2-m2m, does it matter?

Guessing that’s the way ffmpeg wants it presented. Thinking it would error out if you change it.

ok, rewrite to --enable-v4l2-m2m, no error came up?

When you get it installed see how it compares to this:

[ray@jellyfin]$ ffmpeg -hide_banner -decoders | grep -E "v4l"
 V..... h263_v4l2m2m         V4L2 mem2mem H.263 decoder wrapper (codec h263)
 V..... h264_v4l2m2m         V4L2 mem2mem H.264 decoder wrapper (codec h264)
 V..... hevc_v4l2m2m         V4L2 mem2mem HEVC decoder wrapper (codec hevc)
 V..... mpeg1_v4l2m2m        V4L2 mem2mem MPEG1 decoder wrapper (codec mpeg1video)
 V..... mpeg2_v4l2m2m        V4L2 mem2mem MPEG2 decoder wrapper (codec mpeg2video)
 V..... mpeg4_v4l2m2m        V4L2 mem2mem MPEG4 decoder wrapper (codec mpeg4)
 V..... vc1_v4l2m2m          V4L2 mem2mem VC1 decoder wrapper (codec vc1)
 V..... vp8_v4l2m2m          V4L2 mem2mem VP8 decoder wrapper (codec vp8)
 V..... vp9_v4l2m2m          V4L2 mem2mem VP9 decoder wrapper (codec vp9)