Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3 fixes for simpletest_raspicam.cpp on raspbian #11

Open
marcmerlin opened this issue May 10, 2021 · 1 comment
Open

3 fixes for simpletest_raspicam.cpp on raspbian #11

marcmerlin opened this issue May 10, 2021 · 1 comment

Comments

@marcmerlin
Copy link

marcmerlin commented May 10, 2021

Hi,

I just checked out the latest version on raspbian/rPi4.
The included example works fine, but when I tried to compile the sample code given on
http://www.uco.es/investiga/grupos/ava/node/40

  1. sleep is not found, I had to add
    #include <unistd.h>

  2. build is missing -L/opt/vc/lib/. I had to build with
    g++ simpletest_raspicam.cpp -o simpletest_raspicam -I/usr/local/include -L/opt/vc/lib/ -lraspicam -lmmal -lmmal_core -lmmal_util

  3. runtime warning

root@rPi4b:~/raspicam/example# ./simpletest_raspicam 
Opening Camera...
Sleeping for 3 secs
/root/raspicam/src/private/private_impl.cpp:179 :Private_Impl::retrieve type is not RASPICAM_FORMAT_IGNORE as it should be
Image saved at raspicam_image.ppm

not sure what the fix should be, but the ppm file works, so that's the important part

@marcmerlin marcmerlin changed the title 3 fixes for raspbian 3 fixes for simpletest_raspicam.cpp on raspbian May 10, 2021
@marcmerlin
Copy link
Author

I did try to add Camera.setEncoding ( raspicam::RASPICAM_ENCODING_RGB );
but I get

simpletest_raspicam.cpp:22:12: error: ‘class raspicam::RaspiCam’ has no member named ‘setEncoding’; did you mean ‘setMetering’?
     Camera.setEncoding ( raspicam::RASPICAM_ENCODING_RGB );`

I guess the example on http://www.uco.es/investiga/grupos/ava/node/40 is probably against an old more restricted API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant