Trouble capturing still images with StillCapture role on Raspberry Pi

Barnabás Pőcze barnabas.pocze at ideasonboard.com
Thu May 15 10:36:51 CEST 2025


Hi

2025. 05. 15. 5:58 keltezéssel, dominik greitmann írta:
> Hello,
> I am currently setting up a Raspberry Pi Camera using the |libcamera| library.
> I would like to capture still images and therefore want to use the *StillCapture* role. However, I am having trouble finding the correct format or reading the image data from the buffer and saving it as an image file.
> With the *Viewfinder* role, everything works fine, but since I care about the quality of the images, I would prefer to use the *StillCapture* role.
> Here is my setup:
> 
>   *
>     Raspberry Pi Camera v2.1
>   *
>     Raspberry Pi 4 Model B Rev 1.2
> 
> I've also attached the relevant code files and an example image.

I think one issue that the the buffer mapping part of the code
completely ignores `FrameBuffer::Plane::offset`.
See https://gitlab.freedesktop.org/camera/libcamera/-/blob/f3a12332f6d987b34893b2a41294dba6db5feb39/src/libcamera/mapped_framebuffer.cpp#L180
for one way you can map a frame buffer for access. This probably
won't fix your issue because the Y plane most likely comes first,
with an offset of 0.


Regards,
Barnabás Pőcze

> I would be very grateful for any help or suggestions.
> Best regards,
> Dominik Greitmann



More information about the libcamera-devel mailing list