Libcamera-apps built from source does not have autofocus option

I am using IMX230 and followed the instructions in “1.2. Build from the source code” to build libcamera and libcamera-apps.

The built binaries do not accept the --autofocus option.

On the other hand, the pre-compiled binaries does accept the --autofocus option.

Do I need to add any options at build time?

I found the following in the documentation.

Note: Please install the Arducam latest version of libcamera-dev and libcamera-apps, and update the firmware of Pivariety(contacting Arducam: [email protected]) if the camera can not autofocus.

Hi @genarks

Yes, we have added some controls, but we haven’t released its source code yet (the changes are a bit ugly), if you need it, I can send you a patch.

Hello @wong

That’s a very nice offer!!
Could you please send me the patch?

Thank you.

base on: 729df015fb37ab25abd73c4832f9e7fa5d1cb8de
libcamera-apps.patch (2.3 KB)

base on: 579f55b1086db0d7df1608ad24513a673818f408
libcamera-focus.patch (2.0 KB)


Thanks @wong

I modified the signal handler in libcamera-vid to autofocus when a signal is received.

IMX230 is very cool!!!

I’m glad you like it. Since libcamera does not have auto focus support yet, we added this hack ourselves. Its implementation is a bit ugly. I believe libcamera will officially add auto focus support in the near future. I am looking forward to it.

1 Like

I just found this patches here. I have two questions:

  1. Are this still the latest versions of this patches?
  2. Do they still apply to the current main branche ob libcamera-apps?
  3. Could you place the patches somewhere on GitHub, where it is easier to find them?
  4. What is the license of this patches?

Basically, yes.

No, you need to pay attention to the commit information on the patch.

Thanks for the suggestion, we’re sorting it out, I think we should be able to create a fork of libcamera-apps.

It’s currently not explicitly specified, you can think of it as the same BSD 2-Clause protocol as libcamera-apps.

1 Like

Thanks for the answers. :+1: A fork of libcamera-apps would be grate, please ping me if you created something usable.

FYI I made a fork of the latest libcamera-apps with the patches included:

@wong Any update on the release of the source code ? I need to build a custom version of libcamera-jpeg and it has been more than a year since you said you would release it.

Thanks for the help


We have made the source code open source and available to the public.