Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. GStreamer-CRITICAL Error with QCamera

GStreamer-CRITICAL Error with QCamera

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 2 Posters 1.3k 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.
  • S Offline
    S Offline
    Simof
    wrote on last edited by Simof
    #1

    Dear All,

    I tried to run a simple project with QCamera and QMultimedia but my Camera isn't recognized correctly from GStreamer.

    This is my code:

    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    
        QCamera* camera;
    
        const QList<QCameraInfo> cameras = QCameraInfo::availableCameras();
        for (const QCameraInfo &cameraInfo : cameras)
        {
            qDebug() << cameraInfo.deviceName();
            if (cameraInfo.deviceName() == "/dev/video0")
                camera = new QCamera(cameraInfo);
        }
    
        qDebug() << camera;
    
        camera->start();
    }
    

    This is the output:

    "/dev/video0"
    QCamera(0x564b000daee0)
    Starting camera without viewfinder available
    
    (testCamera:4537): GStreamer-CRITICAL **: 12:43:01.419: gst_pad_get_current_caps: assertion 'GST_IS_PAD (pad)' failed
    
    (testCamera:4537): GLib-GObject-CRITICAL **: 12:43:01.419: g_object_set: assertion 'G_IS_OBJECT (object)' failed
    
    (testCamera:4537): GLib-GObject-CRITICAL **: 12:43:01.419: g_object_set: assertion 'G_IS_OBJECT (object)' failed
    CameraBin error: "GStreamer error: negotiation problem."
    Unable to query the parameter info: QCameraImageProcessingControl::WhiteBalancePreset : "Invalid argument"
    Unable to query the parameter info: QCameraImageProcessingControl::ColorTemperature : "Invalid argument"
    Unable to query the parameter info: QCameraImageProcessingControl::SharpeningAdjustment : "Invalid argument"
    CameraBin error: "Internal data stream error."
    

    And this is the caracteristics of camera

    Ubuntu 20.04 - Qt 5.12

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

      Hi and welcome to devnet,

      Can you access that camera properly from GStreamer on the command line ?

      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
      • S Offline
        S Offline
        Simof
        wrote on last edited by
        #3

        No I've not find the right setting of GStreamer for my camera, the connection made Error after a few second.

         gst-launch-1.0 v4l2src ! jpegdec ! xvimagesink
        

        This i s the command I tried.

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

          Then are you sure your camera is working properly ?
          Which kernel version are you using ?
          Did you check if you have any message related to the camera in your logs ?

          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
          • S Offline
            S Offline
            Simof
            wrote on last edited by
            #5

            The camera works fine with Guvcview but not working on Cheese.

            My environment is Ubuntu 20.04 LTS on VirtualMachine, kernel version 5.8.0-55-generic

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

              Can you test the pipeline suggested in this stack overflow answer ?

              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
              • S Offline
                S Offline
                Simof
                wrote on last edited by
                #7

                Yes, I've already tested

                gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg,width=640,height=480 ! decodebin ! ximagesink
                
                Setting pipeline to PAUSED ...
                Pipeline is live and does not need PREROLL ...
                Setting pipeline to PLAYING ...
                New clock: GstSystemClock
                ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
                Additional debug info:
                gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
                streaming stopped, reason not-negotiated (-4)
                Execution ended after 0:00:00.417171499
                Setting pipeline to PAUSED ...
                Setting pipeline to READY ...
                Setting pipeline to NULL ...
                Freeing pipeline ...
                
                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  I wonder if it's a configuration issue. The default might be requesting something wrong.

                  Can you for example force the image size to ensure it's something your camera supports ?

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

                  S 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    I wonder if it's a configuration issue. The default might be requesting something wrong.

                    Can you for example force the image size to ensure it's something your camera supports ?

                    S Offline
                    S Offline
                    Simof
                    wrote on last edited by
                    #9

                    @SGaist

                    in what way?
                    This is the driver configuration

                    2021-06-10 15_42_36-Window.png

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

                      Sorry ! The code rendering made me miss that you configured the width/height of the image.

                      One thing that looks wrong is the FPS that cannot be determined. I wonder if the issue lies there.

                      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
                      • G guilherme andrade referenced this topic on

                      • Login

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