[libcamera-devel] How to use this library

Jason H jhihn at gmx.com
Fri Mar 26 21:55:16 CET 2021


So I can't find any good getting started guide on how to use this, and there isn't a
liubcamera-users email list that I can find. But my own attempts have resulted in frequent crashing.

I am trying to use the libcamera-apps fom RaspberryPi:
https://github.com/raspberrypi/libcamera-apps

However my efforts have been not successful in adapting their code.
I don't want any preview - I just want to get images (memory access ok, if it
is RGB888, BGR888, or I'll also accept file output as well) I don't want a preview,
window, and I only want/need one frame per second (a sequence of stills). The code
is already written against another library with a timer to acquire frames.

My instant problem is on my pi (with a camera) it does not find any cameras: (cameras().size() == 0)

camera_manager_ = std::make_unique<CameraManager>();
int ret = camera_manager_->start();
if (ret)
    throw std::runtime_error("camera manager failed to start, code " + std::to_string(-ret));

if (camera_manager_->cameras().size() == 0)
    throw std::runtime_error("no cameras available");

There is stuff in the v4l tree:
/dev/v4l/by-path/platform-bcm2835-codec-video-index0
/dev/v4l/by-path/platform-bcm2835-isp-video-index1
/dev/v4l/by-path/platform-bcm2835-isp-video-index3
/dev/v4l/by-path/platform-bcm2835-isp-video-index0
/dev/v4l/by-path/platform-bcm2835-isp-video-index2

I don't know what to do next.
Help?



More information about the libcamera-devel mailing list