[libcamera-devel] [PATCH] Add enable_auto_focus option to the GStreamer plugin
Nicolas Dufresne
nicolas at ndufresne.ca
Fri Jun 2 18:10:44 CEST 2023
Hi Laurent,
Le vendredi 02 juin 2023 à 08:19 +0300, Laurent Pinchart a écrit :
> For libcamerasrc, I don't know if the same reasoning should lead to the
> same result, or if we should consider that the vast majority of use
> cases for the GStreamer element call for enabling auto-focus by default.
> I currently side towards doing the same as in the libcamera core, as I
> believe it would be confusing for users to have different default
> behaviours when using libcamera through different adaptation layers.
> However, I could also imagine enabling auto-focus by default in the V4L2
> adaptation layer for instance, as that layer is mostly meant to expose
> libcamera-based cameras as webcams.
>
I like to decide based on what the users get by default. A mimic of what a
webcam usually do seems logical. What do you get in the simplest form of usage
of the software (in GStreamer this means if you just plug and start the element:
libcamerasrc ! ...).
Not enabling it (or not setting the lense to a decent default position) on HW
that needs to be focused means most of the time you'll just get a bad output.
This impose more complexity on the application. Being a low level library does
not imply it have to be difficult across multiple type of cameras. Its no more
effort to disable then to enable it either.
Of course, this can either happen in libcamera or in libcamerasrc element, that
I don't care so much. I don't have the full portrait on auto-focus quality atm
to judge if now is the time either, and which type of auto focus we should
enable vs which one we should definitely avoid as it would make things worst. I
would certainly not rush into "getting something" for that reason. But for sure,
the design principle for the gstreamer element (and same will apply for the
pipewire one) is that it goes from really simple to full control, and nothing
special should be done to get a good image. This is mostly the reason why the
element assume you can always use the cameras with a single stream (hopefully
this will stay true ;-P). So assuming auto-focus feature actually works (I have
no mean to verify), enabling it would mean it behaves similar to what webcam do.
Nicolas
More information about the libcamera-devel
mailing list