kbarni / LCCV

LibCamera wrapper library for OpenCV
61 stars 30 forks source link

running examples terminates with camera not available #6

Closed atalkingegg closed 2 years ago

atalkingegg commented 2 years ago

Hello, Here's the output when I try to run takephoto...

0 Opening camera... [186:44:12.125952427] [14582] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3415-76530215 [186:44:12.154250783] [14591] WARN CameraSensorProperties camera_sensor_properties.cpp:141 No static properties available for 'imx477' [186:44:12.154330226] [14591] WARN CameraSensorProperties camera_sensor_properties.cpp:143 Please consider updating the camera sensor properties database [186:44:12.154495149] [14591] ERROR CameraSensor camera_sensor.cpp:551 'imx477 10-001a': Camera sensor does not support test pattern modes. [186:44:12.321544655] [14591] INFO RPI raspberrypi.cpp:1317 Registered camera /base/soc/i2c0mux/i2c@1/imx477@1a to Unicam device /dev/media2 and ISP device /dev/media0 terminate called after throwing an instance of 'std::runtime_error' what(): selected camera is not available Aborted

"libcamera-hello -t 0" has similar startup INFO/WARN/ERROR/RPI messages, but then proceeds to work. "takevideo" has the same problem. Any suggestions as to what's happening? Thanks!

BTW; the cam.options->width and height for 4056, 3040 were fixed to photo_width and photo_height, as optimal for imx477, with the 2028, 1520 lines commented out.

JuergenSmo commented 2 years ago

Hi, have you tried to run "sudo rpi-update" yet? I have experienced during my test's a month ago that libcamera and libcamera-apps highly depend on the correct versions of each other. And if I've used the versions from github, if I remember correctly, I also got that error. Mostly I was able to solve that using this command. Personally I decided to use only the official released package, coming with apt. Even if i may miss some functionality I have no issues anymore.

BR.

atalkingegg commented 2 years ago

Yes, I just posted the project https://github.com/atalkingegg/simpler-cam and have other libcamera code/apps working. From the output it looks like it successfully finds and tries to open the camera but doesn't like to talk to it. I just realized some possible reasons - I'm running on a Raspberry 4 64-bit OS. Has this been tried on both 32-bit and 64-bit? Also, I'm running on the latest libcamera, as there's been some major video stability improvements in the last two days. If you have code instrumentation suggestions, I'd be happy to help figure this out.

JuergenSmo commented 2 years ago

I made all my work on Raspberry (Debian Bullseye) on 32bit only.

kbarni commented 2 years ago

For me, the example runs without problems.

However, when I try to wrap it into a Qt QCoreApplication, I get the selected camera is not available message too (however it works with a QApplication).

I will investigate further.

kbarni commented 2 years ago

Corrected in commit 0425fc78763edf1176653a3c8d63b32501512160