Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Black screen while run "declarative-camera" on Raspberry Pi 3
I facing an issue when running examples from Qt Creator named "declarative-camera" on Raspberry Pi 3 leading to black screen instead of video.
The same project runs just fine on laptop (Ubuntu 16).
The point is that there are no debug logs nor any error / warning message.
Any ideas how to start to debug in order to find out "why" ?
Where is a start point to investigate?
My first guess would be missing gstreamer-0.1 or gstreamer-1.0 libraries on your Pi.
Which Qt version are you using, by the way? Judging from name "declarative-camera" I fear you are still on Qt 4 instead of Qt 5.
Are you cross-compiling or have you built Qt natively on Pi?
@sierdzio Thanks for the replay and sorry for not provided full information initially.
I downloaded whichever is the latest Qt Creator available just a days ago:
Qt Creator 4.0.2
Based on Qt 5.7.0 (GCC 4.9.1 20140922 (Red Hat 4.9.1-10), 64 bit)
I installed gstreamer-0.9 and there is no other version installed, because I faced an issue with gstreamer-1.0 and Qt5.7 and found that it should be exactly version 0.9
I installed environment based on:
However, I skipped section:
"if you are using a 64 bit Ubuntu you need to modify the above line to: "
But I do not think this could be an issue here.
So, I compiled it on my desktops Ubuntu and deploy into Raspberry Pi.
Application runs on Rasp Pi side, I am seeing GUI, but no video and there is no messages in the Application output at all.
I m wondering, is there a way to turn on debugging somehow? There must be something that prints debug messages.
Hm, OK so your setup seems to be fine.
If you can't get the messages from the app, you can try installing a message handler: qInstallMessageHandler. This will allow you to - for example - save all the application output to some file on your rPi for later viewing.
I'm not sure if QML camera object handles EGLFS, never tried it myself.
Basically I am trying to switch from Java / Python into C++ in order to get my projects work faster and efficiently by gaining C++ power, I am working on computer vision.
I found this example as more suitable for me to get Camera object on Rasp Pi.
Can you suggest any other / better way to get video stream with GUI?
Thanks in advance.
Hey, I'm not saying your approach is wrong, only that I don't have enough experience in this area to help you further. Camera should work crossplatform, if it does not it is a bug in Qt, not yours.
Try with message handler - perhaps Qt is printing some crucial error info to the console and you miss it currently.
Will try this evening to use it, let's see what I'll get.
I removed gstreamer 0.9 and 0.10 from RPi and installed 1.0.
Also, I included qInstallMessageHandler(myMessageOutput);
Now, I am facing the same issue as described here:
At least I am seeing some useful message. However, as noticed in the provided post, I am not able to solve the new issue ...
I found that "Unfortunately the GStreamer-based multimedia stuff is not quite usable at the time of writing - accelerated video works only sometimes (and with glitches), while the camera is just broken."
Thanks once again for the help :-)
OK, that is what I suspected will be in the error messages.
Right then, happy coding with raspicam! :D