I'm trying to work out whether it's possible to get hardware accelerated playback on an RPi4 with a recent 64-bit OS/kernel. It looks like there's about a million different ways this is supposed to work, but as yet I haven't come across one that does. Many ways use OMX or MMAL which aren't available in 64-bit, with everything seeming to move towards v4l2m2m but if I'm wrong please correct me.
What I want to do is to show four H264 video streams across two monitors. Can anyone confirm whether this is possible?
If I use ffplay normally to do this, I only get around 10fps in each of the four videos and all four CPUs are pegged at 100% and I get thermal throttling, so it looks like this is doing software decoding.
This ffmpeg command is the only one that seems to allow me to read the video stream in real time, at around 40% CPU usage for a single stream:
Code: Select all
$ ffmpeg -codec:v h264_v4l2m2m -i udp://126.96.36.199:5004 -probesize 32 -c:v rawvideo -f avi - | cat > /dev/null Stream #0:0[0x100]: Video: h264 (High) ( / 0x001B), yuv420p(progressive), 972x1296, 30 fps, 30 tbr, 90k tbn, 180k tbc [h264_v4l2m2m @ 0x55a507f3d0] Using device /dev/video10 [h264_v4l2m2m @ 0x55a507f3d0] driver 'bcm2835-codec' on card 'bcm2835-codec-decode' in mplane mode [h264_v4l2m2m @ 0x55a507f3d0] requesting formats: output=H264 capture=YU12 Stream mapping: Stream #0:0 -> #0:0 (h264 (h264_v4l2m2m) -> rawvideo (native))
Code: Select all
$ ffplay -codec:v h264_v4l2m2m udp://188.8.131.52:5004 -probesize 32 [h264_v4l2m2m @ 0x7f4402a4c0] Using device /dev/video10 [h264_v4l2m2m @ 0x7f4402a4c0] driver 'bcm2835-codec' on card 'bcm2835-codec-decode' in mplane mode [h264_v4l2m2m @ 0x7f4402a4c0] requesting formats: output=H264 capture=YU12
Is there a way to tell the hardware decoder to output in RGB, or to get a hardware accelerated method for drawing YUV420 pixel data?