[libcamera-devel] "cam" utility is quite confusing

Eric Curtin ecurtin at redhat.com
Tue Aug 2 10:11:29 CEST 2022


On Sat, 30 Jul 2022 at 10:26, Kieran Bingham via libcamera-devel
<libcamera-devel at lists.libcamera.org> wrote:
>
> Hi Pavel,
>
> Quoting Pavel Machek via libcamera-devel (2022-07-29 20:56:20)
> > Hi!
> >
> > I just spent quite some time debugging C++... when problem was in my
> > commnad line.
>
> I'm sorry to hear that. cam is just a test tool, so indeed it possibly
> doesn't have the friendliest CLI - but it should still be expected to be
> usable, so I think you've hit a very valid bug.
>
> > First, --sdl needs to come up after -c. Okay, documentation warns
> > about that "Options valid in the context of --camera:".
> >
> > Second, AFAICT, you can not have file output and sdl viewfinder at the
> > same time.
>
> That's an internal limitation at the moment I think that each buffer is
> only processed by one output. It could be extended to support more I
> believe.
>
>
> > Third, and most confusing... --sdl will not actually display anything
> > unless you also pass -C. I don't think help text is really clear about
> > that.
> >
> > I believe command line interface could be improved (automatically
> > assume -C when --sdl is passed? allow --sdl before -c?), or at least
> > documenation should be clear about these limitations.
>
> This sounds good to me - --sdl doesn't make sense if it's not actually
> capturing, so I think an implicit -C is fine. Would you like to submit a
> patch for this?

-D and -F also don't make sense unless the device is capturing frames.
I agree that an implicit -C0 (same as -C), -C1, -C10 or some other
default number would be ok, but it would be nice to keep -D, -F and -S
sort of consistent. It would make sense if all these options captured
frames by default.

>
> I think the --sdl still needs to be within the context of a camera
> though. But I do wonder if we could default the first context to be the
> first camera? (Removing the need to explicitly set a -c ?
>
> --
> Kieran
>
>
> >
> > Best regards,
> >                                                                 Pavel
> >
> > --
> > People of Russia, stop Putin before his war on Ukraine escalates.
>



More information about the libcamera-devel mailing list