[PATCH] cam: Convert RGB variations to BGR

Kieran Bingham kieran.bingham at ideasonboard.com
Mon May 12 23:40:21 CEST 2025


Quoting Milan Zamazal (2025-05-12 19:00:08)
> Pavel Machek <pavel at ucw.cz> writes:
> 
> > Hi!
> >
> >> > From looking at the code, soft ISP seemed to be able to do other stuff
> >> > than ARGB, but for some reason ARGB is selected by default, and I
> >> > guess I can get better performance by forcing right format.
> >> 
> >> Software ISP debayering supports multiple output formats and `cam' can
> >> request a particular output format.  For example,
> >> 
> >>   cam -c1 -C4 -s pixelformat=BGR888 -Ffoo#.ppm
> >> 
> >> outputs the right thing.  Example of requesting an output in a different
> >> format:
> >> 
> >>   cam -c1 -C4 -s pixelformat=ARGB8888 -Ffoo#.raw
> >> 
> >> It works; is it a problem in your application?
> >
> > Well, problem is that if you do something like "cam -c1 -Ffoo#.ppm" it
> > decides to use ARGB8888 and fails writing into ppm. That is not great.
> 
> Maybe `cam' could be enhanced to select BGR888, if available, in case
> ppm file output is requested.

I've long wanted cam to be able to negotiate between the capabilities of
the camera and the output sink and report (or use) the intersection of
supported formats ;-)

(Which means I think we could still add conversions in cam file sinks -
but perhaps try to prioritise formats that do not do conversions in any
format negotations)
--
Kieran

>


More information about the libcamera-devel mailing list