Since the Raspberry Pi is transitioning from using the old raspistill
and raspivid
to the newer libcamera
how should I take an image now if I don't want to use the CLI nor C as programming language? I can't find any wrapper for libcamera
in any language other than C and the new official Picamera2 library is also in an alpha phase and not recommended for production use.
I am also using a 64-bit version of the Raspberry Pi OS so I can't use the legacy camera interface. I could downgrade to 32-bit but where is the point in deprecating the old system if the new one is clearly not ready for productive use.
How do you guys handle using the camera of the Raspberry Pi at the moment if you want to use a wrapper like Picamera? Am I missing something?
At the moment, the best way, if you want to use
bullseye
, is probably to runlibcamera-vid
and pipe the output from that into a Python script. You can either use asubprocess()
call, or just start a pipeline:Be sure to read from
sys.stdin.buffer
like here to avoid CR/LF mangling.Probably choose a YUV-based format to ensure frames are a deterministic length, as opposed to MJPEG where the frame length will vary according to image content and you'll have to search for JPEG SOI/EOI markers.