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

Camera board • Persuading libcamera to give me the stream combinations I want

$
0
0
I am using a Pi-camera-3-wide-no-IR on a PiZero2W with the very latest libcamera (built from source) working in C++. I am trying to persuade libcamera to give me two streams: one lowish resolution 640x480-RGB888 stream (based on the Viewfinder role) that can be processed as efficiently as possible by OpenCV and a second higher quality stream to record, something like1920x1080-YUV420 (based on the VideoRecorder role) that I can view/save.

I don't really care what the video recording stream is, provided it is as high a quality as I can get, what I mostly care about is that the lower resolution stream can be imported into OpenCV with minimal overhead (this is a PiZero2W), which I understand needs RGB888, and I definitely don't need a load of pixels (just for motion detection).

My problem is that the validation function never lets me have the lower resolution stream in the form I want. I've tried the following:

Ask: (0) 1920x1080-YUV420 (1) 640x480-RGB888, get: (0) 1920x1080-YUV420 (1) 640x480-YUYV
Ask: (0) 640x480-RGB888, (1) 1920x1080-YUV420 get: (0) 640x480-YUYV (1) 1920x1080-YUV420 (swapped order in case that matters)
Ask: (0) 1920x1080-RGB888 (1) 640x480-RGB888, get: (0) 1920x1080-RGB888 (1) 640x480-YUYV (try asking for the same format type)
Ask: (0) 1920x1080-XRGB8888 (1) 640x480-RGB888, get: (0) 1920x1080-XRGB8888 (1) 640x480-YUYV (dunno, worth a try)
Ask: (0) 1920x1080-XRGB8888 (1) 640x480-XRGB8888, get: (0) 1920x1080-XRGB8888 (1) 640x480-YUYV (again, worth a try)

I can never get the lower resolution stream in RGB888. What am I doing wrong?

Statistics: Posted by Rob Meades — Sat Nov 30, 2024 1:18 pm



Viewing all articles
Browse latest Browse all 5057

Trending Articles