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. Can't load Camera in Debian virtual machine

Can't load Camera in Debian virtual machine

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 3 Posters 646 Views 2 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.
  • D Offline
    D Offline
    diego-qt
    wrote on last edited by
    #1

    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-qtmultimedia
    

    But 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.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      diego-qt
      wrote on last edited by
      #2

      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/video0
      

      And if I add a log in the code, I can see that it detects the webcam, but it is not possible to load somehow.

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

        Hi,

        What about accessing it with GStreamer directly since the error lies in there.

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

        D 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          What about accessing it with GStreamer directly since the error lies in there.

          D Offline
          D Offline
          diego-qt
          wrote on last edited by
          #4

          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

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

            A quick search returns this blog which contains several examples.

            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
            0
            • D diego-qt

              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

              JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by JoeCFD
              #6

              @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

              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