Can you modify camera settings while libcamera is running?

With the older V1 and V2 standard Pi cameras, using v4l2-ctl, it was possible to modify settings (exposure, brightness, contrast, gain, etc) WHILE THE CAMERA WAS RUNNING. But other than the Arducam python script for focus adjustment, I haven’t seen a way to issue setting changes through libcamera-vid while it is already running.
Does anyone know how to do that? Is a python script the only way to modify camera settings on-the-fly? When I’m streaming, it’s nice to be able to adjust the picture quality, but I’m just not sure how to do that on this new setup.

It appears that the “v4l2-ctl” command has no usable options when running this propietary camera. They call it v4l2 compatible, but that must just be at the very lowest level.

hi, @ldwellman

Currently the sample programs in libcamera-apps do not implement runtime control.

You can try to set the control at runtime with the v4l2-ctl -c command.

With the prior cameras (V1 and V2), yes, I was able to modify parameters on-the-fly with the ‘v4l2-ctl’ command, but with this new Hawkeye 64mp camera, I cannot use the v4l2-ctl command. If you have figured out a way to do that, please explain with more details. But for me, any attempt to issue a v4l2-ctl command FAILS, as shown below:

$ v4l2-ctl -d /dev/video0 -c contrast=1
unknown control 'contrast'
$ v4l2-ctl --list-ctrls
$    <-- I get NOTHING - no usable controls available!

That’s what I meant earlier when I said “It appears that the ‘v4l2-ctl’ command has no usable options when running the proprietary camera.”

However, I see that there is the focus Python script that somehow CAN make on-the-fly changes, so at least the focus motor is controllable during video operation.

After making a few videos with this new 64mp, I have a lot more questions, but I guess I need to post them separately. I was hoping this higher quality camera would make our videos better, but so far, it’s been about equal to the older V1 camera…and I had more control over that camera to improve the video image. :frowning:

hi, @ldwellman

Sorry, due to changes in the internal framework of the new version of libcamera, it can no longer be used with the v4l2 command at the same time.

If you want to set the control at runtime, you may need to implement it yourself.Just like the python script you see for runtime control.

Should we only be using /dev/v4l-subdev0 and 1 for camera control of the 64mp camera? Because /dev/video0-n dont seem to be exposing any controls.

hi, @flor1s

Thank you for reminding. I used the following command to test it, and I can see the control information.

v4l2-ctl -d  /dev/v4l-subdev0 -l

The new Raspberry Pi system cannot obtain control information from the/dev/video0-n node.

However, when the libcamera-still command runs, it does not seem ideal using this method. libcamera-still always sets this value again.

Thanks, @yang

Sorry for hijacking the topic somewhat. Can I ask one additional question?

Is it possible to autofocus with a Python script? The only way I can get the camera to autofocus as far as I know is with libcamera-still --autofocus

Yes, autofocus can be achieved using our wrapped libcamera python library.

However, this library has some issues running with 64mp cameras, which we are working on fixing. . .

1 Like

Thank you for the information.

I should have mentioned I am using Picamera2, by the way. Maybe I should wait for your version of that.

We tested the picamera2 before and it couldn’t set autofocus.

I think we will modify picamera2 later to support all the features of our camera.

@flor1s @ldwellman

We currently find a solution that can use Python to implement autofocus and set control when running.