Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Webcam preview with Qt Quick
QtWS25 Last Chance

Webcam preview with Qt Quick

Scheduled Pinned Locked Moved Solved QML and Qt Quick
webcamqtquickqml
13 Posts 3 Posters 5.5k 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.
  • A Offline
    A Offline
    Aras
    wrote on 12 Aug 2016, 23:08 last edited by Aras 8 Dec 2016, 23:11
    #1

    I am planning to embed a webcam view in my application. In order to understand how that works I tried running the declerative camera sample project. It builds and runs, however I do not see any video from camera -- the view is just black. In the application output inside Qt Creator, I see the following errors:

    Starting /home/aras/Qt5.7.0/Examples/Qt-5.7/multimedia/build-declarative-camera-Desktop_Qt_5_7_0_GCC_64bit-Debug/declarative-camera...
    QML debugging is enabled. Only use this in a safe environment.
    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.camera"
    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
    qrc:///VideoCaptureControls.qml:110: Error: Cannot assign [undefined] to QString
    qrc:///CameraListButton.qml:65:5: QML CameraListPopup: Binding loop detected for property "currentValue"
    qrc:///PhotoCaptureControls.qml:135: Error: Cannot assign [undefined] to QString
    qrc:///CameraListButton.qml:65:5: QML CameraListPopup: Binding loop detected for property "currentValue"
    /home/aras/Qt5.7.0/Examples/Qt-5.7/multimedia/build-declarative-camera-Desktop_Qt_5_7_0_GCC_64bit-Debug/declarative-camera exited with code 0
    

    Why do you think the sample program is not working? Am I missing some libraries?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jerome_isAviable
      wrote on 13 Aug 2016, 01:58 last edited by
      #2

      Hi Aras,
      Did you include multimedia (for QML) and/or multimediawidgets (for C++ QWidget code) in your .pro project file ?
      Could you paste your code (you can use service paste from gist github maybe... this can be able to add many different files) ?
      Or maybe if you have a public test-case application on git or bitbucket something like that, i would be happy to contribute.
      Also, could you tell us wich environment you are running on ? (linux, Osx, Windows)

      1 Reply Last reply
      1
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 13 Aug 2016, 06:33 last edited by
        #3

        Hi,

        Do you have GStreamer installed ? If so which version ?

        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
        • A Offline
          A Offline
          Aras
          wrote on 15 Aug 2016, 18:53 last edited by
          #4

          @jerome_isAviable I am using the declarative camera sample app that comes with Qt installation without any modification, so I assume this is not an error in the code, but something with my environment.

          I am using Ubuntu Linux 16.06 64bit. Here is are my gstreamer packages:

          $ sudo dpkg -l |grep gstreamer
          ii  gir1.2-gstreamer-1.0                            1.8.2-1~ubuntu1                                             amd64        GObject introspection data for the GStreamer library
          ii  gstreamer-qapt                                  3.0.2-0ubuntu1.1                                            amd64        GStreamer plugin to install codecs using QApt
          ii  gstreamer1.0-alsa:amd64                         1.8.2-1ubuntu0.1                                            amd64        GStreamer plugin for ALSA
          ii  gstreamer1.0-clutter-3.0                        3.0.18-1                                                    amd64        Clutter PLugin for GStreamer 1.0
          ii  gstreamer1.0-fluendo-mp3:amd64                  0.10.32.debian-1                                            amd64        Fluendo mp3 decoder GStreamer 1.0 plugin
          ii  gstreamer1.0-libav:amd64                        1.8.2-1~ubuntu1                                             amd64        libav plugin for GStreamer
          ii  gstreamer1.0-plugins-bad:amd64                  1.8.2-1ubuntu0.1                                            amd64        GStreamer plugins from the "bad" set
          ii  gstreamer1.0-plugins-bad-faad:amd64             1.8.2-1ubuntu0.1                                            amd64        GStreamer faad plugin from the "bad" set
          ii  gstreamer1.0-plugins-bad-videoparsers:amd64     1.8.2-1ubuntu0.1                                            amd64        GStreamer videoparsers plugin from the "bad" set
          ii  gstreamer1.0-plugins-base:amd64                 1.8.2-1ubuntu0.1                                            amd64        GStreamer plugins from the "base" set
          ii  gstreamer1.0-plugins-base-apps                  1.8.2-1ubuntu0.1                                            amd64        GStreamer helper programs from the "base" set
          ii  gstreamer1.0-plugins-good:amd64                 1.8.2-1ubuntu0.1                                            amd64        GStreamer plugins from the "good" set
          ii  gstreamer1.0-plugins-ugly:amd64                 1.8.2-1ubuntu0.1                                            amd64        GStreamer plugins from the "ugly" set
          ii  gstreamer1.0-plugins-ugly-amr:amd64             1.8.2-1ubuntu0.1                                            amd64        GStreamer plugins from the "ugly" set
          ii  gstreamer1.0-pulseaudio:amd64                   1.8.2-1ubuntu0.1                                            amd64        GStreamer plugin for PulseAudio
          ii  gstreamer1.0-tools                              1.8.2-1~ubuntu1                                             amd64        Tools for use with GStreamer
          ii  gstreamer1.0-x:amd64                            1.8.2-1ubuntu0.1                                            amd64        GStreamer plugins for X11 and Pango
          ii  libgstreamer-plugins-bad1.0-0:amd64             1.8.2-1ubuntu0.1                                            amd64        GStreamer development files for libraries from the "bad" set
          ii  libgstreamer-plugins-base1.0-0:amd64            1.8.2-1ubuntu0.1                                            amd64        GStreamer libraries from the "base" set
          ii  libgstreamer-plugins-good1.0-0:amd64            1.8.2-1ubuntu0.1                                            amd64        GStreamer development files for libraries from the "good" set
          ii  libgstreamer1.0-0:amd64                         1.8.2-1~ubuntu1                                             amd64        Core GStreamer libraries and elements
          ii  libreoffice-avmedia-backend-gstreamer           1:5.1.4-0ubuntu1                                            amd64        GStreamer backend for LibreOffice
          ii  phonon-backend-gstreamer:amd64                  4:4.8.2-0ubuntu2                                            amd64        Phonon GStreamer 1.0 backend
          ii  phonon-backend-gstreamer-common:amd64           4:4.8.2-0ubuntu2                                            amd64        Phonon GStreamer 1.0.x backend icons
          ii  phonon4qt5-backend-gstreamer:amd64              4:4.8.2-0ubuntu2                                            amd64        Phonon Qt5 GStreamer 1.0 backend
          
          

          Sorry for the late reply guys! I did not realize you had replied. I just enabled email notification in my profile for this forum (they were disabled by default). I appreciate your help!

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Aras
            wrote on 15 Aug 2016, 19:32 last edited by
            #5

            Here is the application output in Qt Creator:

            Starting /home/aras/Qt5.7.0/Examples/Qt-5.7/multimedia/build-declarative-camera-Desktop_Qt_5_7_0_GCC_64bit-Debug/declarative-camera...
            QML debugging is enabled. Only use this in a safe environment.
            defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.camera"
            defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
            qrc:///VideoCaptureControls.qml:110: Error: Cannot assign [undefined] to QString
            qrc:///CameraListButton.qml:65:5: QML CameraListPopup: Binding loop detected for property "currentValue"
            qrc:///PhotoCaptureControls.qml:135: Error: Cannot assign [undefined] to QString
            qrc:///CameraListButton.qml:65:5: QML CameraListPopup: Binding loop detected for property "currentValue"
            /home/aras/Qt5.7.0/Examples/Qt-5.7/multimedia/build-declarative-camera-Desktop_Qt_5_7_0_GCC_64bit-Debug/declarative-camera exited with code 0
            
            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 15 Aug 2016, 20:10 last edited by
              #6

              IIRC, the gstreamer backend is built against 0.1 so one thing you could do is re-build the plugin against 1.0.

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

              A 1 Reply Last reply 15 Aug 2016, 20:23
              0
              • S SGaist
                15 Aug 2016, 20:10

                IIRC, the gstreamer backend is built against 0.1 so one thing you could do is re-build the plugin against 1.0.

                A Offline
                A Offline
                Aras
                wrote on 15 Aug 2016, 20:23 last edited by
                #7

                @SGaist can you elaborate how I could do that? It there a Qt module that I need to rebuild and reinstall?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 15 Aug 2016, 20:56 last edited by
                  #8

                  The QtMultimedia module provides the backends. You don't need to rebuild the whole module, just the gstreamer backend.

                  You can grab the sources from the installer to get you started.

                  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
                  • A Offline
                    A Offline
                    Aras
                    wrote on 15 Aug 2016, 23:18 last edited by
                    #9

                    I went into software repository and installed anything matching gstreamer1.0* and then tried running the sample app again. Now the video is working. So it was a dependancy on one of the gstreamer1.0 packages. Unfortunately I dont know which one.

                    Thank you for your help @SGaist and @jerome_isAviable !

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      Aras
                      wrote on 17 Aug 2016, 21:36 last edited by
                      #10

                      I am now having this exact problem on a second machine. Searching through repository for any packages related to gstreamer and installing them -- it seems so ad hoc!

                      Is there any way to see in Qt Creator or in the application output what library should be providing the camera service? That way I can just install that library instead of the other 200 and be sure I got it right. Any suggestions?

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 17 Aug 2016, 21:38 last edited by
                        #11

                        I'm not 100% sure but I think it's the gst-plugins-good package.

                        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
                        • A Offline
                          A Offline
                          Aras
                          wrote on 22 Aug 2016, 19:01 last edited by
                          #12

                          Thanks for the hint @SGaist ! On this new install it was the gstreamer0.10-plugins-good set that I was missing. I had the version 1.0 installed instead of 0.1.

                          I am going to mark this thread as resolved, but I still would like to know if there is a better way to figure out what library is missing. So if you know, please chime in! Thanks!

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 22 Aug 2016, 21:00 last edited by
                            #13

                            You're welcome !

                            If you would like to use the latest version of gstreamer, you'll likely have to re-build the QtMultimedia backend.

                            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

                            10/13

                            17 Aug 2016, 21:36

                            • Login

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