AnsweredAssumed Answered

Camera usage with Qt QML

Question asked by Benjamin Hess on Jan 9, 2014
Latest reply on Sep 3, 2014 by Dmitry Pozhidaev

Hi

 

I'm trying to get the camera working in a QML project. The setup is a imx6DL with an embedded linux built with yocto. I'm using Qt 5.1.1.

 

 

The camera works with:

gst-launch mfw_v4lsrc ! mfw_v4lsink

QtMultimedia supports a camera interface with Camera/VideoOutput. I follow the simple examples but it doesn't work. When i'm trying to display the camera with QML. The camera/videooutput item in QML just displays nothing and the console shows:

(qt5-gui-integration:4156): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(qt5-gui-integration:4156): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
(qt5-gui-integration:4156): GStreamer-CRITICAL **: gst_object_ref: assertion `object != NULL' failed
(qt5-gui-integration:4156): GStreamer-CRITICAL **: gst_object_sink: assertion `GST_IS_OBJECT (object)' failed
(qt5-gui-integration:4156): GStreamer-CRITICAL **: gst_element_get_bus: assertion `GST_IS_ELEMENT (element)' failed
(qt5-gui-integration:4156): GStreamer-CRITICAL **: gst_bus_add_watch_full: assertion `GST_IS_BUS (bus)' failed
(qt5-gui-integration:4156): GStreamer-CRITICAL **: gst_bus_set_sync_handler: assertion `GST_IS_BUS (bus)' failed
(qt5-gui-integration:4156): GStreamer-CRITICAL **: gst_object_ref: assertion `object != NULL' failed
(qt5-gui-integration:4156): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed
(qt5-gui-integration:4156): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed
(qt5-gui-integration:4156): GLib-GObject-CRITICAL **: g_object_get: assertion `G_IS_OBJECT (object)' failed
(qt5-gui-integration:4156): GStreamer-CRITICAL **: gst_element_set_state: assertion `GST_IS_ELEMENT (element)' failed
(qt5-gui-integration:4156): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed
(qt5-gui-integration:4156): GStreamer-CRITICAL **: gst_element_get_state: assertion `GST_IS_ELEMENT (element)' failed
(qt5-gui-integration:4156): GLib-GObject-CRITICAL **: g_object_get: assertion `G_IS_OBJECT (object)' failed
(qt5-gui-integration:4156): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed
(qt5-gui-integration:4156): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed
(qt5-gui-integration:4156): GStreamer-CRITICAL **: gst_element_set_state: assertion `GST_IS_ELEMENT (element)' failed
(qt5-gui-integration:4156): GStreamer-CRITICAL **: gst_element_set_state: assertion `GST_IS_ELEMENT (element)' failed
(qt5-gui-integration:4156): GStreamer-CRITICAL **: gst_bus_set_sync_handler: assertion `GST_IS_BUS (bus)' failed
(qt5-gui-integration:4156): GStreamer-CRITICAL **: gst_object_unref: assertion `object != NULL' failed
(qt5-gui-integration:4156): GLib-CRITICAL **: g_source_remove: assertion `tag > 0' failed

 

Now i found out that QtMultimedia uses various backends to support multiple platforms. On linux it uses the GStreamer backend. A new backend can also be written but i'd like to use the GStreamer backend.

 

A reason might be, that the gstreamer source is mfw_v4lsrc but usually the source is name v4l2src (this one doesn't work on the board). Maybe the GStreamer backend of QtMultimedia uses v4l2src and therefore can't open the camera. But i haven't found any documentation how to change that.

 

Has anyone the camera working with Qt QML (QtMultimedia)?

Does anyone know how to get it running?

 

Cheers

Ben

Outcomes