ayufan / camera-streamer

High-performance low-latency camera streamer for Raspberry PI's
291 stars 46 forks source link

arducam 16mb imx519 autofocus does not work #146

Open nicoolaro opened 3 months ago

nicoolaro commented 3 months ago

I am using default template for 16mb, camera works but focus is awful very blurry. In the template AF is set to 1

-camera-auto_focus=1 \

i also tried

-camera-auto_focus=2 \

and -camera-options=AfMode=2 \

\ what is also interesting is if i go to /control and change AF mode , absolutely nothing changes, am i doing something wrong?

If i follow arducam guide install fresh on bullseye for this camera and use libcamera-still -t 5000 -n -o test.jpg , focus is good.

Thanks Screenshot 2024-03-28 201314

nicoolaro commented 3 months ago

I believe i found the issue, at least i hope it is, imx519.json i had was not the same as one here, newest has this code:

{ "rpi.af": { "ranges": { "normal": { "min": 0.0, "max": 12.0, "default": 1.0 }, "macro": { "min": 3.0, "max": 15.0, "default": 4.0 } }, "speeds": { "normal": { "step_coarse": 1.0, "step_fine": 0.25, "contrast_ratio": 0.75, "pdaf_gain": -0.02, "pdaf_squelch": 0.125, "max_slew": 2.0, "pdaf_frames": 20, "dropout_frames": 6, "step_frames": 4 } }, "conf_epsilon": 8, "conf_thresh": 16, "conf_clip": 512, "skip_frames": 5, "map": [ 0.0, 0.0, 15.0, 4095 ] } } ] }

which enabled autofocus and controls

Mine old json is located at : /usr/share/libcamera/ipa/rpi/vc4/ so i just replaced it with new one from the link