Recent

Author Topic: libcamera for Raspberry Pi etc.  (Read 5140 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
libcamera for Raspberry Pi etc.
« on: August 23, 2021, 09:26:27 am »
Has anybody looked at libcamera? This is a fairly new library which operates in parallel with the standard v4l2 stuff and provides extra facilities on e.g. the new Raspberry Pi 12MPx camera.

https://libcamera.org/index.html  https://libcamera.org/entries/2020-05-05.html

HOWEVER, if I'm reading https://git.linuxtv.org/libcamera.git/tree/src properly it appears to be defined in C++, so it's not possible to use it directly from Lazarus.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

BlueIcaro

  • Hero Member
  • *****
  • Posts: 793
    • Blog personal
Re: libcamera for Raspberry Pi etc.
« Reply #1 on: September 09, 2021, 11:48:30 am »
Hi, de package Sdpo, use v4l2 to access to a usb cam (I think). I played with it at work. Now I'm hollidays, so I cant checkit,

v4l2 it a "driver" to access to vídeo cam, tv decoders, etc in linux.
And it's written in C.

You can find the documentation: https://www.kernel.org/doc/html/v4.15/media/uapi/v4l/v4l2.html

As soon I arrive to work, I going to check my work with V4l2 and lazarus. I can share with you the information about v4l2 and  lazarus.

/BlueIcaro





MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
Re: libcamera for Raspberry Pi etc.
« Reply #2 on: September 09, 2021, 12:04:17 pm »
v4l2 it a "driver" to access to vídeo cam, tv decoders, etc in linux.
And it's written in C.

I know, I've been using it for twenty years.

Now tell me what you know about libcamera.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

af0815

  • Hero Member
  • *****
  • Posts: 1291
Re: libcamera for Raspberry Pi etc.
« Reply #3 on: September 10, 2021, 10:33:30 am »
i see the same as you MarkMLI, it looks C++ and not useable direct by fpc/Lazarus and i see no additive goodies for me.

v4l and gstreamer are well known and settled in fpc/Lazarus but libcamera ist not a must have for me. And if you use gstreamer you can use libcamera as an extra source. So i think it is better to use gstreamer :-) direct.

AND gstreamer is available on Linux/Raspibian and Windows too.
regards
Andreas

MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
Re: libcamera for Raspberry Pi etc.
« Reply #4 on: September 10, 2021, 11:13:46 am »
i see the same as you MarkMLI, it looks C++ and not useable direct by fpc/Lazarus and i see no additive goodies for me.

v4l and gstreamer are well known and settled in fpc/Lazarus but libcamera ist not a must have for me. And if you use gstreamer you can use libcamera as an extra source. So i think it is better to use gstreamer :-) direct.

AND gstreamer is available on Linux/Raspibian and Windows too.

Recent versions of libcamera can do things like retrieving the image status in a way that can be used to drive autofocus. I believe that if it's being used to capture the video that can be emitted as status messages, so while messy I think that a development framework written using e.g. Lazarus could exploit that.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

BlueIcaro

  • Hero Member
  • *****
  • Posts: 793
    • Blog personal
Re: libcamera for Raspberry Pi etc.
« Reply #5 on: September 14, 2021, 03:24:26 pm »
Hi, I never work with libCamera, but a quick glance, I found that there is some C files (I think), in a folfer called "Include", here:
https://github.com/kbingham/libcamera/tree/master/include/libcamera

May some one with more knowledge than me, in this library can tell us if we can use the library with this files.

/BlueIcaro

MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
Re: libcamera for Raspberry Pi etc.
« Reply #6 on: September 14, 2021, 04:37:59 pm »
I'd missed that since I was looking at the official repository. I'll take a look at that when I have a chance and report back.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
Re: libcamera for Raspberry Pi etc.
« Reply #7 on: September 16, 2021, 03:31:18 pm »
No, that's still C++. camera.h is full of class definitions etc.

Code: C  [Select][+][-]
  1. class FrameBuffer;
  2. class FrameBufferAllocator;
  3. class PipelineHandler;
  4. class Request;
  5.  
  6. class CameraConfiguration
  7. {
  8. public:
  9.         enum Status {
  10.                 Valid,
  11.                 Adjusted,
  12.                 Invalid,
  13.         };
  14.  
  15.         using iterator = std::vector<StreamConfiguration>::iterator;
  16.         using const_iterator = std::vector<StreamConfiguration>::const_iterator;
  17.  
  18.         virtual ~CameraConfiguration();
  19. ...
  20.  

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018