Hi all, hoping someone can help. I’ve got a Raspberry Pi with a 16MP AF IMX519 camera and I’m trying to grab video at the camera’s full resolution with libcamera-vid, but I get nothing back. It works fine at 4056x3040, but at full res there’s just no video. When I list the modes libcamera reports the mode as valid and the camera says it’s setting it, but the output comes out empty. Anyone seen this before?
Quick clarification on what the sensor can actually do here. The way the Pi’s video mode works, it tops out at 1920x1080, so anything above that in video mode isn’t going to behave the way you’d expect. The IMX519 sensor itself maxes out at 4656x3496, but that resolution is only available in still mode, not video mode. So for the maximum resolution you’d want to use still capture instead: run libcamera-still --list-cameras to see what modes are actually exposed, and then try something like libcamera-still -t 0 --viewfinder-width 4656 --viewfinder-height 3496 to get the full-res image.
Thanks, but I don’t think that’s quite right. I can already get 4056x3040 out of libcamera-vid, so it’s clearly not stopping at 1080p for me. Here’s exactly what I’m running:
libcamera-vid --codec mjpeg -t 5000 --segment 1 -o test_%04d.jpg --width 4056 --height 3040 --framerate 20 --exposure normal
That produces 4056x3040 jpgs fine. The problem is I can’t push it to the full resolution at all - it just won’t go there. Any other ideas?
Fair point, and you’re right - MJPEG isn’t hit by the same 1920x1080 cap that H.264 video mode is, so pulling stills out of libcamera-vid at higher res can definitely work. Blank output when you push toward the full sensor resolution usually points at buffer/CMA memory rather than the mode itself being invalid. Can you paste your /boot/config.txt? And if possible, what does dmesg show around the camera starting up when you attempt the full res capture?
Sure, here’s the config.txt:
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
[pi4]
dtoverlay=vc4-kms-v3d
max_framebuffers=2
[all]
I don’t see anything unusual in dmesg, just the normal camera detection lines, nothing that looks like an outright error.
Try bumping the CMA allocation. With the KMS driver the default CMA is often too small to hold a full 4656x3496 frame buffer, which would explain the empty output at the top resolution while 4056x3040 still squeezes through. Edit /boot/config.txt and change the overlay line to dtoverlay=vc4-kms-v3d,cma-512, reboot, then retry your libcamera-vid command.
That did it! Changed it to dtoverlay=vc4-kms-v3d,cma-512, rebooted, and now the full res capture works without any trouble. Really appreciate the help.
Nice, glad that sorted it. To recap for anyone else finding this thread: the 1920x1080 limit only applies to the H.264 video mode, so if you’re pulling MJPEG stills at high res that cap doesn’t bite you. The blank output at the full IMX519 resolution was a CMA memory issue, and setting dtoverlay=vc4-kms-v3d,cma-512 in /boot/config.txt fixed it. Just keep in mind that if you actually need full-resolution video rather than MJPEG frames, that’s still constrained by the Pi’s video pipeline, so the still-mode route remains the reliable way to get the sensor’s maximum resolution.