[libcamera-devel] libcamera on pinephone

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Jun 21 14:14:28 CEST 2022


Hi Pawel,

On Mon, Jun 20, 2022 at 02:07:11PM +0200, Pavel Machek wrote:
> Hi!
> 
> > > > > Yes, cam does that.
> > > > 
> > > > `cam -l` to list cameras
> > > > `cam -c 1 -C 10` to capture 10 frames from the first camera
> > > 
> > > Heh, that one does not work:
> > > 
> > > mobian at mobian:~/g/libcamera$ build/src/cam/cam -c 1 -C 10
> > > Invalid non-option argument '10'
> > > 
> > > It attempts to work with long option:
> > > 
> > > $ build/src/cam/cam -c 1 --capture=10
> > > 
> > > Sounds like problem in argument parsing?
> > 
> > Sorry, I meant -C10. The count is optional so for short arguments it has
> > to be specified without any space.
> 
> Would something like this make sense?
> 
> 
> diff --git a/README.rst b/README.rst
> index f81d6e2e..e89dba98 100644
> --- a/README.rst
> +++ b/README.rst
> @@ -101,6 +101,13 @@ for android: [optional]
>  for lc-compliance: [optional]
>          libevent-dev
>  
> +Basic testing with cam utility
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +cam utility can be used for basic testing. You may want to start with
> +"LIBCAMERA_LOG_LEVELS=*:DEBUG build/src/cam/cam -c 1 -I --capture=10 --file=/tmp/".
> +
> +

That makes sense, yes. I'd extend it a bit to also mention `cam -l`. How
about the following ? I've dropped the /tmp argument to --file as that's
not very relevant to this minimal example.


Basic testing with cam utility
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``cam`` utility can be used for basic testing. You can list the cameras
detected on the system with ``cam -l``, and capture ten frames from the first
camera and save them to disk with ``cam -c 1 --capture=10 --file``. See
``cam -h`` for more information about the ``cam`` tool.

In case of problems, a detailed debug log can be obtained from libcamera by
setting the :ref:`LIBCAMERA_LOG_LEVELS <log levels>` environment variable:

.. code::

    :~$ LIBCAMERA_LOG_LEVELS=*:DEBUG cam -l


with this additional change:

diff --git a/Documentation/environment_variables.rst b/Documentation/environment_variables.rst
index 0a7760cbea42..dcfdb1a33a32 100644
--- a/Documentation/environment_variables.rst
+++ b/Documentation/environment_variables.rst
@@ -86,8 +86,10 @@ global environment:
    :~$ export LIBCAMERA_LOG_LEVELS='Camera:DEBUG,V4L2:DEBUG'
    :~$ cam --list

+.. _log levels:
+
 Log levels
-~~~~~~~~~~~
+~~~~~~~~~~

 This is the list of available log levels, notice that all levels below
 the chosen one are printed, while those above are discarded.



Would you like to submit a patch, or should I ?

>  Using GStreamer plugin
>  ~~~~~~~~~~~~~~~~~~~~~~
>  

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list