Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8374

Camera board • Re: libcamera::ScalerCrop question

$
0
0
Hi, thanks for the question. It might be helpful to give some (simple) commands that you have tried, as I'm not entirely sure what you mean by "using libcamera and ffmpeg APIs". However, I can still make some more general points.

If you want full field of view, then you need to make sure you're getting a full field of view camera mode, or at least one where cropping to the 720p aspect ratio won't chop off more than is necessary.

Our rpicam-apps have a --mode (or --viewfinder-mode) parameter that lets you select camera modes explicitly You can discover the available modes with "rpicam-hello --list-cameras".

In Python you can request explicit sensor modes too, using either the "sensor" configuration parameter or by specifying a raw output stream. There's more information on this in section 4.2.2.3 (page 21) of the manual. This mirrors pretty closely how the libcamera C++ API works too, in case that's what you're using.

Some of the libcamera compatibility layers (e.g. v4l2 or gstreamer) aren't so good at taking this information and passing it through, so you probably don't get precise control of the sensor (unless things have changed recently). That would make them unsuitable for a number of use cases, and speaking personally, I would avoid them.

The scaler crop control only applies _after_ the image has been read from the sensor. So you need to get the sensor mode right first. Normally there's no need to specify a scaler crop because the pipeline will automatically set up the crop so that you get the largest part of the image that you can. So if you have a 4:3 aspect ratio sensor mode, and your output is 720p, it will automatically apply the correct letter-boxing.

I don't know if any of that helps, but if you can supply the command you're using (or at least, a simple cut-down version thereof) then we can probably give you some more specific advice.

Statistics: Posted by therealdavidp — Thu Nov 27, 2025 8:26 am



Viewing all articles
Browse latest Browse all 8374

Trending Articles