You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: I was told in mpv's IRC channel that mpv also uses ffmpeg's libavcodec for the v4l2m2m decoder.
It works for some videos, but for others, playback never starts and the decoder seems to be stuck.
It seems to be related to the bitrate: I tried one video, downloaded from youtube in 720p and 1080p variants (see "Steps to reproduce"), and only the 1080p variant fails.
$ doas vcgencmd version
Dec 7 2024 13:02:17
Copyright (c) 2012 Broadcom
version 3858f977ab6d689a226ad24d26749266762b7160 (clean) (release) (start)
$ uname -a
Linux myhostname 6.12.13-0-rpi #1-Alpine SMP PREEMPT Thu Feb 13 22:15:47 UTC 2025 aarch64 Linux
I am attaching logs from mpv -v --hwdec=v4l2m2m-copy and from strace -y mpv --hwdec=v4l2m2m-copy (only the last couple of thousand lines). mpv_v4l2m2m-copy_console.log mpv_v4l2m2m-copy_strace.log
It always ends on this line until I press Ctrl+C and killall -9 mpv:
The same RPi 3B with Arch Linux ARM has Kodi and ffmpeg with downstream patches for what I picked up as "the requests API". Here the same videos play flawlessly, but for my application I want to use Alpine without downstream patches.
The text was updated successfully, but these errors were encountered:
Mainline FFmpeg does the wrong thing with stateful decode in some situations, hence the decode stalls. That's not something that would get fixed in the kernel.
(Gut feel is that you need jc-kynesim/rpi-ffmpeg@7f8ee20, but I get lost around FFmpeg patches).
So I tried applying jc-kynesim/rpi-ffmpeg@b149dc9 (same patch you linked to, but based on ffmpeg-6.1) to the APKBUILD in Alpine's aports. With two small fixes, it got built successfully.
It is now able to play the video in question, even though it drops frames, looks slow and goes out of sync with the audio.
(Here is a log from mpv, not too interesting: mpv_v4l2m2m-copy_with_patched_ffmpeg.log)
But it seems to give some credibility to the position that the kernel driver shouldn't be blamed.
Describe the bug
I am trying to use the v4l2-mem2mem device to play AVC-encoded videos with hardware decoding on a Pi 3B or Zero 2W:
Note: I was told in mpv's IRC channel that mpv also uses ffmpeg's libavcodec for the v4l2m2m decoder.
It works for some videos, but for others, playback never starts and the decoder seems to be stuck.
It seems to be related to the bitrate: I tried one video, downloaded from youtube in 720p and 1080p variants (see "Steps to reproduce"), and only the 1080p variant fails.
Steps to reproduce the behaviour
When switching to the 720p variant of the same video it works:
Device (s)
Raspberry Pi 3 Mod. B, Raspberry Pi Zero 2 W
System
raspinfo.log
Logs
I am attaching logs from
mpv -v --hwdec=v4l2m2m-copy
and fromstrace -y mpv --hwdec=v4l2m2m-copy
(only the last couple of thousand lines).mpv_v4l2m2m-copy_console.log
mpv_v4l2m2m-copy_strace.log
It always ends on this line until I press Ctrl+C and
killall -9 mpv
:fd 17 refers to
/dev/video10
.I took the strace logs last week; right now it ends like this (I noticed an extra
munmap()
):Additional context
The same RPi 3B with Arch Linux ARM has Kodi and ffmpeg with downstream patches for what I picked up as "the requests API". Here the same videos play flawlessly, but for my application I want to use Alpine without downstream patches.
The text was updated successfully, but these errors were encountered: