Okay so I made some changes/tried things out.
What I wanted initially is as shown in my attachment, I wanted 3 zooms: 1x, 3x, 5x with the resolution multiples being based on the display eg. 640x480.
When I tried to make the video configuration for the 5x zoom eg.
It would not work, initially I thought it was a limitation on the number of times you can call . I would see this message "no such process" when picamera2 would try to start with that config/crash.
I did look at that "camera zoomed in" thread where it shows the resolutions eg.If going higher than that results in 10fps then I'll just stick with that.
Although in order to achieve my 5x zoom, I just upscaled the resolution. Which I initially had 1920x1440, I'm not sure if it actually was using that 2028 combo.
Anyway I'm using cv2.resize eg. width * 1.58, height * 2.22 to get the 5x. I have to rework the math on the resolution/panning since I initially did the multiples of 640x480 but it seems I need to use that 2028x1080
Using MJPEGEncoder now, using cv2.imdecode
I looked into ScalerCrop where it says:
What I wanted initially is as shown in my attachment, I wanted 3 zooms: 1x, 3x, 5x with the resolution multiples being based on the display eg. 640x480.
When I tried to make the video configuration for the 5x zoom eg.
Code:
self.video_config_1x...self.video_config_3x...self.video_config_5x = self.picam2.create_video_configuration( main={"size": (3200, 2400), "format":"RGB888"})Code:
create_video_configurationI did look at that "camera zoomed in" thread where it shows the resolutions eg.
Code:
2028x1520 [40.01 fps - (0, 0)/4056x3040 crop]Although in order to achieve my 5x zoom, I just upscaled the
Code:
2028, 1080Anyway I'm using cv2.resize eg. width * 1.58, height * 2.22 to get the 5x. I have to rework the math on the resolution/panning since I initially did the multiples of 640x480 but it seems I need to use that 2028x1080
Using MJPEGEncoder now, using cv2.imdecode
I looked into ScalerCrop where it says:
I don't get how that's different than calling cv2 crop, maybe performance is better. Or is it taking a high res video and then outputting that bit only so save framerate by not having to use cv2. Alright I'll try that again. The math will change... panning then upscaling...A libcamera.Rectangle consisting of:
x_offset
y_offset
width
height
Statistics: Posted by jcun4128 — Thu Feb 19, 2026 3:15 am