Mpv-0.36 how to setup

Thanks. Downloaded and installed the new rpi-ffmpeg-6.0.

It can play 4K h264 but with a fair bit of dropped frames. CPU resources usage is fairly low. I don’t think it will support HEVC-10bits (earlier rpi-ffmpeg-6.0 crashes the system).

4K-HEVC-10bits immediately crashes the whole system! Per my understanding currenly “VDEC” does not support HEVC 10bits.

Ok. media.ffvpx.enabled default is “true”. Now set it to “false” Firefox 116.0.3 now stream https://www.youtube.com/watch?v=aqz-KE-bpKQ vp09 1080p/60 with much less dropped frame rates (<1% droppe frames). But the CPU resource use is still quite high (all 6 CPU Core > 50% , this lead me to believe no vpu hw acceleration.

Did it change anything involving vp9 in about:support. It is interesting you have less dropped frams using ffmpeg than what firefox has internal.

Not that I notice.

Start Firefox on debug.

libva error: /usr/lib/dri/v4l2_request_drv_video.so init failed
vaInitialize failed 1

  jfl@jfl-gtkpro    MOZ_GFX_DEBUG=1 MOZ_LOG=“PlatformDecoderModule:5” firefox
GLX_TEST: childgltest start
GLX_TEST: get_pci_status start
GLX_TEST: get_pci_status finished
GLX_TEST: x11_egltest start
GLX_TEST: get_egl_status start
GLX_TEST: get_egl_gl_status start
GLX_TEST: get_egl_gl_status finished
GLX_TEST: get_egl_status finished with return: 1
GLX_TEST: get_xrandr_info start
GLX_TEST: get_xrandr_info finished
GLX_TEST: x11_egltest finished
DRI_DRIVER
meson
VENDOR
Mesa
RENDERER
Mali-G52 (Panfrost)
VERSION
OpenGL ES 3.1 Mesa 23.1.4
TFP
TRUE
WARNING
DRM render node not clearly detectable. Falling back to using the only one that was found.
DRM_RENDERDEVICE
/dev/dri/renderD128
MESA_VENDOR_ID
0x2970
MESA_DEVICE_ID
0x001b
TEST_TYPE
EGL
GLX_TEST: childgltest finished
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: DRM render node not clearly detectable. Falling back to using the only one that was found. (t=1.59464) [GFX1-]: glxtest: DRM render node not clearly detectable. Falling back to using the only one that was found.
vaapitest start, device /dev/dri/renderD128
libva error: /usr/lib/dri/v4l2_request_drv_video.so init failed
vaInitialize failed 1
ERROR
VA-API test failed: failed to initialise VAAPI connection.
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: DRM render node not clearly detectable. Falling back to using the only one that was found. (t=1.59464) |[1][GFX1-]: vaapitest: ERROR (t=1.65877) [GFX1-]: vaapitest: ERROR
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: DRM render node not clearly detectable. Falling back to using the only one that was found. (t=1.59464) |[1][GFX1-]: vaapitest: ERROR (t=1.65877) |[2][GFX1-]: vaapitest: VA-API test failed: failed to initialise VAAPI connection.
 (t=1.65884) [GFX1-]: vaapitest: VA-API test failed: failed to initialise VAAPI connection.

v4l2test probing device '/dev/video0'
v4l2test driver meson-vdec card Amlogic Video Decoder bus_info platform:meson-vdec version 393514
V4L2_SPLANE
FALSE
V4L2_MPLANE
TRUE
V4L2_CAPTURE_FMTS
 NM12
V4L2_OUTPUT_FMTS
 VP90 HEVC H264 MPG1 MPG2
V4L2_SUPPORTED
TRUE
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.

(firefox:6280): dconf-WARNING **: 23:04:27.967: unable to open file '/etc/dconf/db/local': /etc/dconf/db/local: invalid gvdb header; expect degraded performance

It is interesting you have less dropped frams using ffmpeg than what firefox has internal.

Just to be clear mpv with rpi-ffmpeg performed much better than Firefox in terms of dropped frames and CPU resources usage.

Firefox with media.ffvpx.enabled = false performed much better than with media.ffvpx.enabled = true in terms of dropped frames.

Seems to be working with mpv.

Yes, mpv and rpi-ffmpeg-6.0 vpu hw acceleration is working with h264 up to 1080p/60.

 jfl@jfl-gtkpro    mpv --gpu-context=wayland --hwdec=v4l2m2m https://www.larmoire.info/jellyfish/media/jellyfish-40-mbps-hd-hevc.mkv
 (+) Video --vid=1 (*) (hevc 1920x1080 29.970fps)
[vo/gpu/wayland] GNOME's wayland compositor lacks support for the idle inhibit protocol. This means the screen can blank during playback.
Using hardware decoding (v4l2m2m).
VO: [gpu] 1920x1080 drm_prime[nv12]
V: 00:00:29 / 00:00:30 (99%) Cache: 0.0s
Invalid video timestamp: 29.997000 -> 29.930000
V: 00:00:29 / 00:00:30 (99%) Cache: 0.0s

Exiting... (End of file)

With 4k-uhd-h264.mkv dropped frames is around 40%.

 jfl@jfl-gtkpro    mpv --gpu-context=wayland --hwdec=v4l2m2m '/home/jfl/Videos/jellyfish-120-mbps-4k-uhd-h264.mkv' 
 (+) Video --vid=1 (*) (h264 3840x2160 29.970fps)
[vo/gpu/wayland] GNOME's wayland compositor lacks support for the idle inhibit protocol. This means the screen can blank during playback.
Using hardware decoding (v4l2m2m).
VO: [gpu] 3840x2160 drm_prime[nv12]
V: 00:00:29 / 00:00:30 (100%) Dropped: 360

Exiting... (End of file)

Firefox wutg roi-ffmpeg-6.0 doesn’t seems to enable vpu hw acceleration on my device. Could it be environmental settings issue?

Well thanks to your rpi-ffmpeg-6.0 packaging, vpu hw acceleration is enabled on mpv.

When Chromium 116 lands on Unstable Branch will check whether vpu hw acceleration enabled.

I do not know anything about your device. @spikerguy might be able to help with firefox.

Thanks but it is mostly @tartanpion PKGBUILD.

I was going to suggest that.

1 Like

Hi @Darksky,

On Rpi4 can the mpv stream jellyfish-120-mbps-4k-uhd-h264.mkv without high dropped frames?

On my device dropped frames 360 is equivalent to 40% dropped frames [360/(30x30)] and video was jerky.

jfl@jfl-gtkpro    mpv --gpu-context=wayland --hwdec=v4l2m2m '/home/jfl/Videos/jellyfish-120-mbps-4k-uhd-h264.mkv' 
 (+) Video --vid=1 (*) (h264 3840x2160 29.970fps)
[vo/gpu/wayland] GNOME's wayland compositor lacks support for the idle inhibit protocol. This means the screen can blank during playback.
Using hardware decoding (v4l2m2m).
VO: [gpu] 3840x2160 drm_prime[nv12]
V: 00:00:29 / 00:00:30 (100%) Dropped: 360

Exiting... (End of file)

Yes it does pretty much like yours. See my above post. Watching the video though I do not see any jerking. There are a huge amount of frames in that video going at 120 mbps.

The reason raising this is per my understanding both our device the vpu should be able to decode 4K/60 smoothly but it did not in my case.

There is a setting in our config.txt to set for 4K/60 monitors but I do not have a 4k/60 monitor.

Mind is 1080p/60 monitor. But I remembered streaming 4K video on Android and it streamed smoothly on my 1080p/60 monitor.

mpv performs well with 1080p/60 so no real impact for my current use case.

I will never use such a high stream. I was just pushing my tests up a notch to see how it would do.

@Darksky @spikerguy,

Just wondering what “libva” packages need to be install in order to trigger Firefox not to fail “libva-v4l2-request”?

Currently on my system the “libva” and “libva-v4l2-request” had been installed. Is this what had been installed in your system only?

“libva-mesa-driver” “libva-utils” and “libva1” had not been installed. Are these packages required?

Additional info:
On Manjaro-Arm-KDE-linux-aml-6.1.42-1 which had "ffmpeg-m2m-1:4.4-7 installed
launching Firefox with Debug Mode, there is NO “v4l2_request_drv_video.so init failed”

O Manjaro-Arm-Gnome-linux-aml-6.1.42-1 which has “rpi-ffmpeg” installed the “v4l2_request_drv_video.so init failed” is there.

But both Firefox does not have vpu hw acceleration as far as I can tell base on CPU Resources used when streaming h264 video.

Manjaro-Arm-KDE-linux-aml-6.1.42-1 Unstable Branch

MOZ_GFX_DEBUG=1 MOZ_LOG=“PlatformDecoderModule:5” firefox

[jfl@jfl-mnjro ~]$ MOZ_GFX_DEBUG=1 MOZ_LOG=“PlatformDecoderModule:5” firefox
GLX_TEST: childgltest start
GLX_TEST: get_pci_status start
GLX_TEST: get_pci_status finished
GLX_TEST: x11_egltest start
GLX_TEST: get_egl_status start
GLX_TEST: get_egl_gl_status start
GLX_TEST: get_egl_gl_status finished
GLX_TEST: get_egl_status finished with return: 1
GLX_TEST: get_xrandr_info start
GLX_TEST: get_xrandr_info finished
GLX_TEST: x11_egltest finished
DRI_DRIVER
meson
VENDOR
Mesa
RENDERER
Mali-G52 (Panfrost)
VERSION
OpenGL ES 3.1 Mesa 23.1.4
TFP
TRUE
WARNING
DRM render node not clearly detectable. Falling back to using the only one that was found.
DRM_RENDERDEVICE
/dev/dri/renderD128
MESA_VENDOR_ID
0x75f0
MESA_DEVICE_ID
0xbc8e
TEST_TYPE
EGL
GLX_TEST: childgltest finished
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: DRM render node not clearly detectable. Falling back to using the only one that was found. (t=1.0686) [GFX1-]: glxtest: DRM render node not clearly detectable. Falling back to using the only one that was found.
vaapitest start, device /dev/dri/renderD128
vaInitialize failed -1
ERROR
VA-API test failed: failed to initialise VAAPI connection.
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: DRM render node not clearly detectable. Falling back to using the only one that was found. (t=1.0686) |[1][GFX1-]: vaapitest: ERROR (t=1.12897) [GFX1-]: vaapitest: ERROR
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: DRM render node not clearly detectable. Falling back to using the only one that was found. (t=1.0686) |[1][GFX1-]: vaapitest: ERROR (t=1.12897) |[2][GFX1-]: vaapitest: VA-API test failed: failed to initialise VAAPI connection.
 (t=1.12904) [GFX1-]: vaapitest: VA-API test failed: failed to initialise VAAPI connection.

v4l2test probing device '/dev/video0'
v4l2test driver meson-vdec card Amlogic Video Decoder bus_info platform:meson-vdec version 393514
V4L2_SPLANE
FALSE
V4L2_MPLANE
TRUE
V4L2_CAPTURE_FMTS
 NM12
V4L2_OUTPUT_FMTS
 VP90 HEVC H264 MPG1 MPG2
V4L2_SUPPORTED
TRUE
ATTENTION: default value of option mesa_glthread overridden by environment.

RPi does not use VAAPI. A lot of those libva programs get installed as depends with various programs to be used if supported by various devices. Since you have HW with mpv and not firefox I would say that the issue is in firefox it’s self and maybe lack of support for your vpu. I have no clue though other than that.

suddenly got this error,
mpv: error while loading shared libraries: libSPIRV.so.12: cannot open shared object file: No such file or directory

I’m not seing that here on the unstable branch. I wonder if you have some git version installed from when you were messing with mpv with HW a while back.

[ray@jellyfin ~]$ ls -lah /usr/lib/libSPIRV.so*
lrwxrwxrwx 1 root root   14 Jul 28 12:33 /usr/lib/libSPIRV.so -> libSPIRV.so.12
lrwxrwxrwx 1 root root   11 Jul 28 12:33 /usr/lib/libSPIRV.so.0 -> libSPIRV.so
lrwxrwxrwx 1 root root   18 Jul 28 12:33 /usr/lib/libSPIRV.so.12 -> libSPIRV.so.12.3.1
-rwxr-xr-x 1 root root 3.1M Jul 28 12:33 /usr/lib/libSPIRV.so.12.3.1
 
[ray@jellyfin ~]$ pacman -Qo /usr/lib/libSPIRV.so.12
/usr/lib/libSPIRV.so.12 is owned by glslang 12.3.1-2
 
[ray@jellyfin ~]$ pacman -Ss glslang
extra/glslang 12.3.1-2 [installed]
    OpenGL and OpenGL ES shader front end and validator
 
[ray@jellyfin ~]$ pacman -Qi glslang
...
Required By     : libplacebo  shaderc
...

ok, downgrade glslang, done & thanks.

edit,
they update glslang but no error appearance?

1 Like

This mourning’s dav1d update breaks rpi-ffmpeg. Here is the rebuild for the package:

md5sum:
23d7a8dfec9e6f2fd364efbd242336da rpi-ffmpeg-6.0.r110072.g61733f14a6-2-aarch64.pkg.tar.zst

https://drive.google.com/file/d/1mG4oYEy6aKSccQNwtNcmYP-CzTGQz7p2/view?usp=sharing

can not access your google drive.

I do not know what was up with that link. Hopefully it works now.