Hi folks, I’m trying to do high frame rate image acquisition on a Raspberry Pi 4 with an imx519 sensor. I really want RAW frames at a high frame rate but I simply can’t get past 30 fps for RAW no matter what settings I try. For normal video I can’t get above ~95 fps either. I ran:
and I only got about 93 fps out of it. I also tried to crop down to 1280x720 by adding --width 720 --height 1280, but that just threw an error and recorded nothing at all. Any idea how I can push the framerate up? Am I missing something obvious?
One more thought on what I’m actually after: the only pixels I care about are the central ones. I’d like to crop the window down so I can devote more processing power to the center and hopefully run at a higher frame rate. Can I command the Pi to ignore the sensor data coming from the periphery? Basically throw away the outer pixels at the sensor level so it doesn’t waste time on them?
Thanks, that helps. Two separate things are going on here.
First, the crop error. You wrote --width 720 --height 1280, which is almost certainly swapped — that asks for a 720-wide, 1280-tall stream, which doesn’t match any usable mode and the pipeline bails out with “Failed to configure camera”. Try --width 1280 --height 720 instead:
Second, and this is the important one: cropping the output window doesn’t reduce the work the sensor does. The imx519 still reads out and transmits the full frame; the ISP just scales/crops afterwards. So you won’t get a big frame rate win by cropping in software. The sensor mode is what determines the readout timing, not the output resolution.
Also worth flagging on your RAW command: libcamera-raw -t 5000 -o output.raw --framerate 60 is a record command. Writing frames out to storage takes real time and that overhead drags the achieved frame rate down below whatever you request. The --framerate value is a request, not a guarantee.
Ok, so retrying with --width 1280 --height 720 does record now, thanks — but the frame rate is basically the same as before, so the crop didn’t buy me anything. That tracks with what you said.
So if the peripheral pixels don’t actually save me any time, what’s the real ceiling here? I’m stuck at ~30 fps for RAW and ~93-95 fps for video even though I’m asking for 120. Is there any sensor mode or pipeline setting that would get me higher, or is this just how it is?
As we discussed earlier in the thread, the frame rate here is mainly limited by the Raspberry Pi hardware, not by the camera or the libcamera configuration. A few points that explain what you’re seeing:
The record path (whether libcamera-raw or libcamera-vid) has to capture, process and write out each frame. That processing/recording time is itself a chunk of each frame interval, and it directly impacts the achievable frame rate. Asking for --framerate 60 or --framerate 120 doesn’t override that ceiling.
RAW is heavier than encoded video, which is why you cap around 30 fps there versus the ~95 fps you see for H.264.
Cropping doesn’t help much because, as mentioned above, the full sensor still has to be read out. There’s no supported way to tell the imx519 to physically skip the periphery during readout and only clock out the central pixels — that’s a sensor mode / silicon behaviour, not something libcamera exposes on this hardware.
So realistically: keep the output resolution down where you can, use a sensor mode whose readout matches what you need, and expect the RAW path to sit around the 30 fps mark on this board.
Got it. Just to be sure I understand — even if I only want the central region, the sensor still clocks out every pixel and I pay for all of them in readout time, so there’s no “free” speedup from ignoring the edges. And the record/write step is eating into the budget on top of that. Is that the whole picture, or is there anything else worth trying?
That’s the whole picture as far as this hardware goes. To summarise where we landed:
Your crop was recording fine once the dimensions were the right way round (--width 1280 --height 720), but it doesn’t improve the frame rate.
The ~30 fps RAW and ~95 fps video ceilings come from the Raspberry Pi hardware, plus the overhead of the record command itself (capture + processing + writing each frame). The --framerate option is a target, not something the pipeline can always hit.
Cropping to the central pixels won’t help, because the sensor still reads out and transmits the full frame — there’s no way to make it skip the periphery and devote more to the centre.
If you want more headroom you’d need to look at reducing per-frame cost (lower resolution, encoded rather than RAW) rather than cropping, but the underlying limit on this board stands. If you do find a config that beats these numbers, post it and others can verify.