[libcamera-devel] libcamerasrc on librem 5: bayer support missing

Nicolas Dufresne nicolas at ndufresne.ca
Mon Dec 19 17:51:05 CET 2022


Le lundi 19 décembre 2022 à 18:11 +0300, Rafael Diniz a écrit :
> This work will also be useful for supporting both Pinephone 1 cameras.

I can only speak for the Pinephone Pro, but it has an ISP which will produce a
proper image. There is very little use, other then scientific data analyses, for
bayer in real-world application.

Nicolas

p.s. Its often discourage to top post.

> 
> Rafael
> 
> On 12/17/22 20:35, Pavel Machek via libcamera-devel wrote:
> > Hi!
> > 
> > > > Is there any way to get libcamerasrc (gstreamer glue) to work on
> > > > Librem 5?
> > > > 
> > > > As far as I can tell, libcamerasrc does not support bayer formats,
> > > > thus I can't really use gstreamer glue on Librem 5.
> > > > 
> > > > Would it be simple to add such support?
> > > > 
> > > 
> > > Simplicity is relative to the knowledge of the dev doing the work. But it
> > > is relatively simple. In GStreamer Bayer formats have their own
> > > media type
> > 
> > I know, but there's a difference in "can be solved with 10 lines of
> > code" and "needs 1000 lines to be written".
> > 
> > > (video/x-bayer). There isn't a libgstbayer library for it, so no custom
> > > stride/padding can be used for now (since nothing is ever set in stone)
> > > though it's much easier. In general, if you add the missing formats, we
> > > request a basic implementation in bayer2rgb and rgb2bayer software
> > > elements. This is extremely useful when using and debugging.
> > > 
> > > Note that "some" patterns are already supported. If it's the case, you just
> > > need to map these into libcamerasrc.
> > 
> > I'm looking for GRBG8 support, so I assume simply doing the mapping
> > should be enough. I guess this is the "10 lines of code" case, but I
> > don't know much about gstreamer or libcamera, so it will likely take
> > me some time to figure which lines...

grbg8 is already implemented in GStreamer, so you just have to map it in
libcamerasrc (in libcamera code). Here's the template caps for bayer2rgb
element, its name format=grbg. Only 8bit packed formats are currently
implemented.

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-bayer
                 format: { (string)bggr, (string)grbg, (string)gbrg,
(string)rggb }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

> > 
> > Best regards,
> > 									Pavel



More information about the libcamera-devel mailing list