[libcamera-devel] libcamera on pinephone

Kieran Bingham kieran.bingham at ideasonboard.com
Mon Jun 20 10:38:28 CEST 2022


Quoting Umang Jain via libcamera-devel (2022-06-20 08:56:05)
> Hi Pavel
> 
> On 6/20/22 12:56, Pavel Machek via libcamera-devel wrote:
> > Hi!
> >
> > I'd like to get video recording to work on pinephone. I had solution
> > with gstreamer (https://gitlab.com/tui/tui/-/tree/master/cam), but
> > gstreamer stopped working (claims colorspace problems and refusees to
> > source data) so I'm looking at other solutions.

Pinephone, or Pinephone pro?

> The support for colorspace in gstreamer plugin is well under active 
> development.
> We have a Google Summer of Code intern who is working on this specifically.

Just to clarify here, libcamera provides a gstlibcamerasrc element which
can link libcamera into gstreamer pipelines. It could be used in place
of your v4l2src in your cam script.

However as Umang referenced, there are still parts under development -
in particular colorspace / colorimetry can cause pipelines to fail to
negotiate. I suspect this differs from your colorspace problems above,
as I don't think you're using the gstlibcamerasrc element yet in that
script.

However, that said, if you want to continue trying gstreamer - if you
specify the full caps you should be able to get something to negotiate.


>From the top level README.rst of libcamera:

 Presently, to prevent element negotiation failures it is required to specify
 the colorimetry and framerate as part of your pipeline construction. For
 instance, to capture and encode as a JPEG stream and receive on another device
 the following example could be used as a starting point:

 .. code::

    gst-launch-1.0 libcamerasrc ! \
         video/x-raw,colorimetry=bt709,format=NV12,width=1280,height=720,framerate=30/1 ! \
         jpegenc ! multipartmux ! \
         tcpserversink host=0.0.0.0 port=5000
 
 Which can be received on another device over the network with:
 
 .. code::
 
    gst-launch-1.0 tcpclientsrc host=$DEVICE_IP port=5000 ! \
         multipartdemux ! jpegdec ! autovideosink
 
 .. section-end-getting-started
 
--
Regards

Kieran



> 
> > What is good way to test libcamera? I'd preffer not to complicate it
> > with gstreamer so far, but I don't see good test application and
> > README does not suggest a way to start.
> >
> > build/test/camera/capture -- sounds like something suitable for basic
> > testing? But it has "platform/vimc.0 Sensor B" hardcoded and that's
> > not present.
> >
> > Are there tools such as list sensors, acquire one frame for testing,
> > ...?
> 
> 
> libcamera has a commandline utility `cam` (under src/cam/). Not sure how 
> easily
> one can compile on PinePhone platform but I would give it try to run  that
> as the first step.
> 
> Others (with PinePhone hardware) might pitch in soon.
> 
> >
> > Best regards,
> >                                                               Pavel


More information about the libcamera-devel mailing list