64MP video in python OpenCV

  1. Where did you get the camera module(s)?

  2. Model number of the product(s)?

  3. What hardware/platform were you working on?
    Raspberry PI 4 (Bullseye)

  4. Instructions you have followed. (link/manual/etc.)

  5. Problems you were having?
    Before: With a cheap camera in raspi Buster, from my python script I could specify video settings and then capture frames with Open CV.

camera_setup_result = os.system(“v4l2-ctl --set-ctrl=scene_mode=0,brightness=60,auto_exposure=1,exposure_time_absolute=20,iso_sensitivity_auto=0,iso_sensitivity=4”)

As 64MP Arducam makes me use Bullseye, this method doesn’t work anymore.

  1. The dmesg log from your hardware?

7. Troubleshooting attempts you’ve made?
I have try many workarounds for days without much success:
In Bullseye:
A. try to use the same code but v2l4-ctl -l doesn’t show any command to be modified).
B. try to use your library (How to use code to access libcamera(C++/Python) - #27 by Hosken79) but it seems to be a little bit slow and doesn’t allow me to change all parameters available in libcamera-vid.

8. What help do you need?
I would like to know which one is the best workaround for doing what I was doing before (in a python script, settling video specs like shutter speed, resolution, gain, fps, etc and then start capturing frames (in order to post processing them with ML).

Hi, @andrestreebo

You can try to use Picamera2. It is the Libcamera Python packaging library with the Raspberry Pi.

I’m having the same issue. How did your code end up looking? I’m trying to open the video feed and grab frames for a CNN.


eventually I end up using Picamera2 library. Once installed, there are many many examples in their github about how to capture frames. They have a pdf with documentation for commands as well.

In my case, I had raspbian OS 32bit and i had to fresh install 64 bits version for Picamera2 to work properly with Arducam.


Glad you got it working properly.

Maybe there is some other error that causes 32-bit systems not to work.

Picamera2 supports both 32-bit and 64-bit.
If you encounter the same problem next time, you can take a screenshot and show me.