2 libcamera rpicam
David Simon edited this page 2025-12-27 21:56:52 -05:00

The Raspberry Pi camera system (using its CSI cable) presents a V4L device via libcamera, but that doesn't do a good job of reporting available resolutions or formats in the way V4L-using apps usually expect. Other libcamera-based systems may have similar issues. You can use v4l2loopback to work around this and create a V4L device that behaves properly.

rpicam-vid -t 0 -n --codec yuv420 --width 2304 --height 1296 -o - | ffmpeg -f rawvideo -pixel_format yuv420p -s 2304x1296 -i - -f v4l2 /dev/video2

(In the above command, /dev/video2 is the loopback device, not the regular V4L device representing the RPi camera.)