64MP AF Camera, libcamera-AfSpeed


I have been mucking around with the arducam 64mp camera and I’ve got it doing what I want (Focusing the camera and then taking a bunch of photos when an object detector detects an object in the frame). However, it takes about 2 seconds for the camera to finish the focus cycle. I am hoping I can speed this up. Looking at the libcamera documentation there is a control to change the AF speed. I cannot get this to work in my code, it basically says it is not “advertied” by libcamera.

I was hoping someone has had some success with this or can I help me debug this. I am familiar with python but pretty rough on c++ which libcamera is written in. I have sifted through the header files used by libcamera and I can find parts that mention “AfSpeed” so I am not too sure why it isn’t found or working.

Link to libcamera documentation:
https://libcamera.org/api-html/namespac … 7632404f4a

Error I get when I try and change the focus speed:
Traceback (most recent call last):
File “/home/pi/Dev/autofocuscam/videoTest.py”, line 48, in
picam2.set_controls({“AfSpeed”: 1})
File “/home/pi/.local/lib/python3.9/site-packages/picamera2/picamera2.py”, line 839, in set_controls
File “/home/pi/.local/lib/python3.9/site-packages/picamera2/controls.py”, line 58, in set_controls
self.setattr(k, v)
File “/home/pi/.local/lib/python3.9/site-packages/picamera2/controls.py”, line 33, in setattr
raise RuntimeError(f"Control {name} is not advertied by libcamera")
RuntimeError: Control AfSpeed is not advertied by libcamera

Cheers, Jack


Not all controls are supported, and we do not currently have support for them. If you would like support, you can contact [email protected]