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. Qt Camera Example not working on Raspberry Pi
Forum Updated to NodeBB v4.3 + New Features

Qt Camera Example not working on Raspberry Pi

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
10 Posts 3 Posters 1.9k Views 3 Watching
  • 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.
  • R Offline
    R Offline
    RickyMarquez
    wrote on last edited by
    #1

    Hi!
    First of all let me say that I'm a beginner with programming and I'm developing a master thesis in a different engineering area so don't take it badly if I miss any detail I should be adding.

    At the moment i'm developing software through cross-compiling from a Ubuntu Virtual Machine to a Raspberry Pi 3+. The cross-compiling works and I had no trouble to run my app in the Pi, I followed this amazing guide.

    However, part of the app is based on obtaining image from a camera and showing it just like it happens with the camera example. Running my code I get this error:

    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.camera"
    ()
    Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created.

    Running the Qt camera example I obtain the same mistake (expected), but I know that the camera works since I've installed Cheese on the raspberry pi and it identifies the camera automatically without need of any input.
    I've been obsessing with this problem for a long time now and can't seem to find a solution that works or that I understand. Please help I'm desperate.

    Thanks!

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

      defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.camera"

      Do you have gstreamer installed?

      Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created.

      Call this before you instantiate Q*Application:

      QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
      

      (Z(:^

      1 Reply Last reply
      2
      • R Offline
        R Offline
        RickyMarquez
        wrote on last edited by
        #3

        @sierdzio

        defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.camera"

        Do you have gstreamer installed?

        Yes, version 1.14.5 on VM and version 1.10.4 on Pi.

        Call this before you instantiate Q*Application:

        QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
        

        This is error doesn't show but the other one remains. I really have no clue on how to proceed.
        Thanks so much for the quick answer

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi and welcome to devnet,

          Please start your application with the QT_DEBUG_PLUGINS environment variable set to 1. It will show information about what is happening.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          R 1 Reply Last reply
          3
          • SGaistS SGaist

            Hi and welcome to devnet,

            Please start your application with the QT_DEBUG_PLUGINS environment variable set to 1. It will show information about what is happening.

            R Offline
            R Offline
            RickyMarquez
            wrote on last edited by
            #5

            @SGaist

            Hi, thanks for answering.

            I've noticed a warning saying " Cannot read .../multimedia/shared/shared.pri". I don't think this is related but it may be worth mentioning.

            About the DEBUG_PLUGINS, I added "qputenv("QT_DEBUG_PLUGINS",QByteArray("1"));" in main.cpp right before QApplication.

            The output was really long but it repeats this :
            Got keys from plugin meta data ("svg", "svgz")
            QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/imageformats/libqtga.so"
            Found metadata in lib /usr/local/qt5pi/plugins/imageformats/libqtga.so, metadata=
            { .....

            For a lot of plugins.
            It ends like this:

            Got keys from plugin meta data ("audiocapture")
            QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qt5pi/examples/multimediawidgets/camera/mediaservice" ...
            defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.camera"
            QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qt5pi/plugins/accessible" ...
            QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qt5pi/examples/multimediawidgets/camera/accessible" ...
            Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created.

            It looks like it doesn't find nothing when checking path "usr/local/qt5pi/examples/multimediawidgets/camera/mediaservice", But then again I'm a complete noob and don't really know what I should be looking for.
            If you think is worth it I can try to post the complete output.

            Thanks so much again for your valuable help!

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Do you have the multimedia plugins in that folder ?
              How did you install Qt on the device ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              R 1 Reply Last reply
              0
              • SGaistS SGaist

                Do you have the multimedia plugins in that folder ?
                How did you install Qt on the device ?

                R Offline
                R Offline
                RickyMarquez
                wrote on last edited by
                #7

                @SGaist

                I installed through this tutorial : https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi/

                I have a lot of folders related to Qt and I think that may be one of my problems.

                On the pi I have a that folder "qt5pi" and a qt5pi/plugins, however there doesn't exist a qt5pi/plugins/multimedia or a qt5pi/plugins/accessible. However if I try to install qtmultimedia (apt-get install qtmultimedia5-dev) on the Pi it says it already has the newest version.
                If I go to usr/local/qt5pi/include/.. I can find there QtMultimedia and QtMultimediaWidgets... Should there be similar pastes in plugins? Thanks!

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Then from the looks of it, the guide does not suggests the Qt multimedia dependencies hence your build is "incomplete" in that regard. Add the GStreamer development packages along the other you installed and rebuild the QtMultimedia module.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  R 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Then from the looks of it, the guide does not suggests the Qt multimedia dependencies hence your build is "incomplete" in that regard. Add the GStreamer development packages along the other you installed and rebuild the QtMultimedia module.

                    R Offline
                    R Offline
                    RickyMarquez
                    wrote on last edited by
                    #9

                    @SGaist

                    Sorry for the delay, I tried yesterday but I'm not sure how to proceed to get the module rebuilt. Do you have any suggestion? Thanks!

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Delete the folder and use the classic qmake/make. Use the full path to the qmake you want to use.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      1

                      • Login

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