[libcamera-devel] [PATCH v2] py: cam.py: Provide live graph of request metadata

Tomi Valkeinen tomi.valkeinen at ideasonboard.com
Mon Jan 16 15:17:53 CET 2023


Hi,

On 13/01/2023 17:42, Daniel Oakley wrote:
> Metadata is very useful when improving specific camera configurations.
> Currently, there is an argument to display the metadata in text form,
> however this can be hard to visualise and spot changes or patterns over
> time. Therefore this proposed patch adds an argument to display this
> metadata in graph form.
> 
> The metadata graph has 3 optional parameters:
>   - refresh, number of times a second to update the graph
>   - buffer, amount of historic/previous data to show
>   - graphs, number of graphs to split the metadata between
>   - autoscale, whether or not to autoscale the axis so all the data fits
> 
> Displaying the graph does have some performance penalty, however this
> has been mostly mitigated through the refresh parameter. Despite this,
> graphing might not the best of ideas when using the camera to record or
> save data. This is mainly for debugging purposes.
> 
> Suggested-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> Signed-off-by: Daniel Oakley <daniel.oakley at ideasonboard.com>
> ---
> This v2 patch remembers to include autoscale in the git message. No code
> difference between the 2.
> 
> This patch is on top of f3f683c9 (py: cam.py: Fix duplicate metadata
> output if more than one steam, 2023-01-12)

I haven't looked at the code itself, but I think if we want the cam.py 
to move into this direction (i.e. having all kinds of stuff instead of 
very simple c++ cam clone (and I'm fine with that direction)), we need 
to modularize it somehow.

You add this code (of substantial amount) into cam.py, and also a rather 
complex arg parsing to the same file. My gut feeling is that we should 
have this in a separate file, preferably also the arg parsing part.

So... probably something similar to the renderers, but for metadata? Or 
are they the same thing, this particular "renderer" would just only deal 
with the metadata. We'd probably also need some generic way to pass 
renderer specific cmdline arguments.

Anyway, just quick thoughts without looking or testing the code yet.

  Tomi



More information about the libcamera-devel mailing list