Can't load Camera in Debian virtual machine
-
Hello,
I've been trying for some days to use my webcam in a QtQuick app in a Debian virtual machine but I haven't been successful. The simplified version of my code is this :import QtQuick 2.15 import QtQuick.Window 2.15 import QtMultimedia 5.15 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") property bool isCameraAvailable: QtMultimedia.availableCameras.length > 0 Camera { id: camera deviceId: isCameraAvailable ? QtMultimedia.availableCameras[0].deviceId : "" captureMode: Camera.CaptureViewfinder } VideoOutput { id: viewfinder anchors.fill: parent source: camera fillMode: Image.PreserveAspectFit } }I have installed the necessary packages :
$ sudo apt install qtmultimedia5-dev qtmultimedia5-examples qtmultimedia5-doc qml-module-qtmultimediaBut I have a blank window and the log gives me this :
(untitled1:5529): GStreamer-CRITICAL **: 12:35:35.378: gst_pad_get_current_caps: assertion 'GST_IS_PAD (pad)' failed (untitled1:5529): GLib-GObject-CRITICAL **: 12:35:35.378: g_object_set: assertion 'G_IS_OBJECT (object)' failed (untitled1:5529): GLib-GObject-CRITICAL **: 12:35:35.378: g_object_set: assertion 'G_IS_OBJECT (object)' failed CameraBin error: "Erreur GStreamer : problème de négociation." Unable to query the parameter info: QCameraImageProcessingControl::WhiteBalancePreset : "Argument invalide" Unable to query the parameter info: QCameraImageProcessingControl::ColorTemperature : "Argument invalide" Unable to query the parameter info: QCameraImageProcessingControl::ContrastAdjustment : "Argument invalide" Unable to query the parameter info: QCameraImageProcessingControl::SaturationAdjustment : "Argument invalide" Unable to query the parameter info: QCameraImageProcessingControl::SharpeningAdjustment : "Argument invalide" CameraBin error: "Internal data stream error."I actually have succeeded in running the app in my Ubuntu host machine but I have to recreate it in my VM.
Any help will be appreciated.
Thank you. -
It is worth noting that I have installed the Extension pack for VirtualBox, I can check/uncheck the webcam in Devices menu and I can use the webcam with VLC with
$ vlc v4l2:///dev/video0And if I add a log in the code, I can see that it detects the webcam, but it is not possible to load somehow.
-
Hi,
What about accessing it with GStreamer directly since the error lies in there.
-
Hi @SGaist,
Do you mean testing out GStreamer from terminal or with Qt ? Do you have any documentation that could lead me there ? I had never heard of GStreamer@diego-qt GStreamer-CRITICAL **: 12:35:35.378: gst_pad_get_current_caps: assertion 'GST_IS_PAD (pad)' failed ===> this is gstreamer error message. That says Qt is using gstreamer underneath on Linux in multimedia module. From the message I can not tell what is wrong.
Check if you have installed all needed gstreamer libs and plugins.
from here
https://gstreamer.freedesktop.org/documentation/tutorials/basic/debugging-tools.html?gi-language=c
export GST_DEBUG=5( or 9)
to see more gstreamer logs