Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Black screen while run "declarative-camera" on Raspberry Pi 3

Black screen while run "declarative-camera" on Raspberry Pi 3

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
10 Posts 2 Posters 3.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yurii Chernyshov
    wrote on last edited by
    #1

    Hi community,
    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?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      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?

      (Z(:^

      Y 1 Reply Last reply
      0
      • sierdzioS sierdzio

        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?

        Y Offline
        Y Offline
        Yurii Chernyshov
        wrote on last edited by
        #3

        @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:
        https://wiki.qt.io/RaspberryPi2EGLFS
        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.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          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.

          (Z(:^

          Y 1 Reply Last reply
          0
          • sierdzioS sierdzio

            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.

            Y Offline
            Y Offline
            Yurii Chernyshov
            wrote on last edited by
            #5

            @sierdzio
            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.

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by sierdzio
              #6

              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.

              (Z(:^

              Y 1 Reply Last reply
              0
              • sierdzioS sierdzio

                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.

                Y Offline
                Y Offline
                Yurii Chernyshov
                wrote on last edited by
                #7

                @sierdzio
                Thanks anywhere!
                Will try this evening to use it, let's see what I'll get.

                1 Reply Last reply
                0
                • Y Offline
                  Y Offline
                  Yurii Chernyshov
                  wrote on last edited by
                  #8

                  Ok,
                  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:
                  https://forum.qt.io/topic/52793/raspberry-pi-qt-5-3-2-qt-camera-not-working-no-service-found-for-org-qt-project-qt-camera

                  P.S.
                  At least I am seeing some useful message. However, as noticed in the provided post, I am not able to solve the new issue ...

                  1 Reply Last reply
                  1
                  • Y Offline
                    Y Offline
                    Yurii Chernyshov
                    wrote on last edited by
                    #9

                    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."
                    https://wiki.qt.io/RaspberryPi2EGLFS#Qt_Multimedia

                    Going to switch to:
                    https://github.com/raspberrypi/userland/tree/master/host_applications/linux/apps/raspicam

                    Thanks once again for the help :-)

                    1 Reply Last reply
                    1
                    • sierdzioS Offline
                      sierdzioS Offline
                      sierdzio
                      Moderators
                      wrote on last edited by
                      #10

                      OK, that is what I suspected will be in the error messages.

                      Right then, happy coding with raspicam! :D

                      (Z(:^

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved