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

Kieran Bingham kieran.bingham at ideasonboard.com
Sat Jul 30 11:26:11 CEST 2022


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?

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