Unsolved GStreamer-CRITICAL Error with QCamera
-
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."
Ubuntu 20.04 - Qt 5.12
-
Hi and welcome to devnet,
Can you access that camera properly from GStreamer on the command line ?
-
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.
-
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 ? -
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
-
Can you test the pipeline suggested in this stack overflow answer ?
-
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 ...
-
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 ?
-
in what way?
This is the driver configuration -
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.
-