How to use qt-gstreamer with qtquick2videosink on Qt5 on Raspberry Pi3

1k Views Asked by At

I built qt-gstreamer from source code on GitHub (version 1.2.0). Then I tried to run qmlplayer2 application (built from qt-gstreamer and use qtquick2videosink) on qt5 on Raspberry Pi3 but I got the following error at runtime:

(gst-plugin-scanner:3749): GStreamer-WARNING **: Failed to load plugin '/usr/lib/gstreamer-0.10/libgstqt5videosink.so': /usr/lib/gstreamer-0.10/libgstqt5videosink.so: undefined symbol: _Z33gst_qt_quick2_video_sink_get_typev Failed to create qtquick2videosink. Make sure it is installed correctly

(qmlplayer2:8517): GStreamer-CRITICAL **: gst_bin_add: assertion 'GST_IS_ELEMENT (element)' failed

(qmlplayer2:8517): GStreamer-CRITICAL **: gst_element_link_pads_filtered: assertion 'GST_IS_ELEMENT (dest)' failed

1

There are 1 best solutions below

4
TuanPM On

Look at source code of qt-gstreamer, i found that the function gst_qt_quick2_video_sink_get_type() is implemented in gstqtquick2videosink.cpp but this file was not compiled due to missing configuration in cmake related to OpenGL.

I config cmake as below :

enter image description here

then rebuild and deploy new file libgstqt5videosink.so to /usr/lib/gstreamer-0.10/libgstqt5videosink.so on target device. After that qmlplayer2 application work fine.