Webcam preview with Qt Quick
-
@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!
-
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
-
IIRC, the gstreamer backend is built against 0.1 so one thing you could do is re-build the plugin against 1.0.
-
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.
-
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 !
-
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?
-
I'm not 100% sure but I think it's the
gst-plugins-good
package. -
Thanks for the hint @SGaist ! On this new install it was the
gstreamer0.10-plugins-good
set that I was missing. I had the version1.0
installed instead of0.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!
-
You're welcome !
If you would like to use the latest version of gstreamer, you'll likely have to re-build the QtMultimedia backend.