salvato
Posts: 49
Joined: Tue Jan 15, 2013 9:21 pm

Is there a c library equivalent to picamera ?

Mon Sep 09, 2019 9:49 am

I'm looking for a C library similar to the Python picamera one.

There is one available ?

Thank you

njm
Posts: 2
Joined: Thu Sep 12, 2019 11:36 am

Re: Is there a c library equivalent to picamera ?

Thu Sep 12, 2019 12:30 pm

yes - it is MMAL library... please see source raspivid from userland

User avatar
DougieLawson
Posts: 35784
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Is there a c library equivalent to picamera ?

Thu Sep 12, 2019 12:54 pm

The source for raspicam and raspivid is available at: https://github.com/raspberrypi/userland that's written in C.

https://github.com/raspberrypi/userland ... s/raspicam is a starting point.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

salvato
Posts: 49
Joined: Tue Jan 15, 2013 9:21 pm

Re: Is there a c library equivalent to picamera ?

Fri Sep 13, 2019 12:32 pm

@njm
@DougieLawson

Thank you for you answers.
I'm studying the raspicam sources and I will base my program, aimed to acquire still images in a controlled way, on this one.
Since i would be able to change at run time some of the many parameters affecting the acquired image I'm thinking to add a Tcp/Ip based connection in order to send the required commands to the so modified raspicam.
Why ?
I'll use Qt to develop user interfaces to the image acquisition program and I've found that I can't have Qt Widgets and camera preview/acquisition at the same time. The only way I've found working is to execute raspistill as a QProcess and send to it a Unix signal in order to acquire an image.
BUT
I can't change the camera parameters without shutting off the rapistill sending a

Code: Select all

kill(..)
and then restarting it again. I think that a Tcp/Ip connection would work better.
To the possible readers of this thread i would suggest to give a look at: https://picamera.readthedocs.io/en/rele ... 3/fov.html
that can give and idea on what is going under the hood of the Raspberry Camera and http://www.jvcref.com/files/PI/documentation/html/ for the MMAL API documentation.

Thank you again

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7124
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Is there a c library equivalent to picamera ?

Fri Sep 13, 2019 1:49 pm

salvato wrote:
Fri Sep 13, 2019 12:32 pm
To the possible readers of this thread i would suggest to give a look at: https://picamera.readthedocs.io/en/rele ... 3/fov.html
that can give and idea on what is going under the hood of the Raspberry Camera and http://www.jvcref.com/files/PI/documentation/html/ for the MMAL API documentation.
PiCamera is built on top of MMAL. All features of PiCamera can therefore be implemented in C, but you are likely to have to roll your own code to do it.

There are a couple of C libraries trying to make a similar API to PiCamera, but I've never used them so can't recommend (or not) them.
https://github.com/cedricve/raspicam is one of them.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Camera board”