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

Camera board • Re: What is faster taking a small picture quickly or video stream capture_array?

$
0
0
Hi, glad you seem to be making progress. Nonetheless I can perhaps provide a bit of background and some tips that might (or might not) be helpful.

Firstly, digital zoom implementations usually keep the size of the output image the same, but "zoom in" on an ever decreasing amount of the source image. I appreciate this isn't what you're after, but in this standard case, the "ScalerCrop" control provides this functionality. You can use it to zoom in on a smaller part of the image and also to pan around in the source.

Stopping and starting the camera is relatively slow and likely to cause "hiccups" in the final stream, though it may be that it's not too significant (especially if recording MJPEG which carries no timing information). I still wonder a little bit whether you couldn't ask for a VGA "lores" stream and a 2x "main" stream simultaneously and encode one, the other, or both at the same time. On Pi 4 or earlier devices (but not the Pi 5) the "lores" stream has to be YUV420, but IIRC the JPEG encoders should these days accept that too.

I don't think you said what kind of Pi or camera you're using, but on lower-powered devices the "MJPEGEncoder" is likely to be more efficient than the "JpegEncoder" because the former has dedicated hardware (on non-Pi 5s), whilst the latter is purely software.

Finally, OpenCV doesn't have much support for YUV420 format images, but cv2.cvtColor can be used to convert it to RGB should you need to do that.

Statistics: Posted by therealdavidp — Sun Feb 15, 2026 10:32 am



Viewing all articles
Browse latest Browse all 8093

Trending Articles