PDA

View Full Version : QMediaPlayer doesn't play anything on Ubuntu 14.04/ Qt 5.7



red-4you
2nd May 2017, 19:37
hello,

I have an problem, I can't play videos on QML on ubuntu 14.04. I have alreay try to build QT5.7 white gstreamer 1.0 but i have those errors.



#### QML Code ###

Rectangle{
id:rectvideo
width: rootrect.width
height: rootrect.height
MediaPlayer {
id: mediaplayer
source: Qt.resolvedUrl("file:///home/user/video1/video1.mp4")
autoPlay: true
loops: Animation.Infinite
}
VideoOutput {
id: previewvid
width: rootrect.width
height: rootrect.height
anchors.fill: parent
source: mediaplayer
visible: true
}
}
****





###### MAIN #####

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QQmlApplicationEngine engine;

controler contrInst;
Camera *camInstMain = new Camera;

QQmlContext *ctx = engine.rootContext();
contrInst.start(); // thread

QObject::connect(&contrInst, SIGNAL(onIMEI_Cont(QString)), &restapiInst, SLOT(sendQueryGetIMEI(QString)));
QObject::connect(&contrInst, SIGNAL(onPostImages_Cont(QString)), &restapiInst, SLOT(sendQueryPostImage(QString)));
QObject::connect(&restapiInst, SIGNAL(signalRqApi(QStringList)), &contrInst, SLOT(apiRequest(QStringList)));
QObject::connect(&contrInst, SIGNAL(onStartCapture(int)), camInstMain, SLOT(startCapture(int)));
QObject::connect(&contrInst, SIGNAL(onStopCapture()), camInstMain, SLOT(stopCapture()));

ctx->setContextProperty("controler", &contrInst);
engine.rootContext()->setContextProperty("ProvedorImagem", camInstMain);
engine.addImageProvider("provedor", camInstMain);

engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}



(recy-interface-FO:12010): GLib-GObject-WARNING **: g_object_set_valist: object class 'GstPlayBin' has no property named 'flags'

(recy-interface-FO:12010): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.40.2/./gobject/gsignal.c:2462: signal 'video-changed' is invalid for instance '0x1dce1d0' of type 'GstPlayBin'

(recy-interface-FO:12010): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.40.2/./gobject/gsignal.c:2462: signal 'audio-changed' is invalid for instance '0x1dce1d0' of type 'GstPlayBin'

(recy-interface-FO:12010): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.40.2/./gobject/gsignal.c:2462: signal 'text-changed' is invalid for instance '0x1dce1d0' of type 'GstPlayBin'

(recy-interface-FO:12010): GLib-GObject-WARNING **: cannot register existing type 'GstObject'

(recy-interface-FO:12010): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(recy-interface-FO:12010): GLib-GObject-CRITICAL **: g_type_register_static: assertion 'parent_type > 0' failed

(recy-interface-FO:12010): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(recy-interface-FO:12010): GStreamer-CRITICAL **: gst_pad_get_current_caps: assertion 'GST_IS_PAD (pad)' failed



$ dpkg -l | grep gstream

ii gir1.2-gstreamer-0.10 0.10.36-1.2ubuntu3 amd64
ii gir1.2-gstreamer-1.0 1.2.4-0ubuntu1.1 amd64
ii gstreamer-tools 0.10.36-1.2ubuntu3 amd64
ii gstreamer0.10-alsa:amd64 0.10.36-1.1ubuntu2 amd64
ii gstreamer0.10-ffmpeg:amd64 0.10.13-5ubuntu1~trusty2.1 amd64
ii gstreamer0.10-fluendo-mp3:amd64 0.10.23.debian-3 amd64
ii gstreamer0.10-nice:amd64 0.1.4-1 amd64
ii gstreamer0.10-plugins-bad:amd64 0.10.23-7.2ubuntu1.3 amd64
ii gstreamer0.10-plugins-bad-multiverse 0.10.21-1ubuntu3 amd64
ii gstreamer0.10-plugins-base:amd64 0.10.36-1.1ubuntu2 amd64 GStreamer plugins from the "base" set
ii gstreamer0.10-plugins-base-apps 0.10.36-1.1ubuntu2 amd64 GStreamer helper programs from the "base" set
ii gstreamer0.10-plugins-good:amd64 0.10.31-3+nmu1ubuntu5 amd64 GStreamer plugins from the "good" set
ii gstreamer0.10-plugins-ugly:amd64 0.10.19-2ubuntu5 amd64 GStreamer plugins from the "ugly" set
ii gstreamer0.10-pulseaudio:amd64 0.10.31-3+nmu1ubuntu5 amd64 GStreamer plugin for PulseAudio
ii gstreamer0.10-tools 0.10.36-1.2ubuntu3 amd64 Tools for use with GStreamer
ii gstreamer0.10-x:amd64 0.10.36-1.1ubuntu2 amd64 GStreamer plugins for X11 and Pango
ii gstreamer1.0-alsa:amd64 1.2.4-1~ubuntu2 amd64 GStreamer plugin for ALSA
ii gstreamer1.0-clutter 2.0.8-1build1 amd64 Clutter PLugin for GStreamer 1.0
ii gstreamer1.0-libav:amd64 1.2.4-1~ubuntu1 amd64 libav plugin for GStreamer
ii gstreamer1.0-nice:amd64 0.1.4-1 amd64 ICE library (GStreamer plugin)
ii gstreamer1.0-plugins-bad:amd64 1.2.4-1~ubuntu1.1 amd64 GStreamer plugins from the "bad" set
ii gstreamer1.0-plugins-bad-faad:amd64 1.2.4-1~ubuntu1.1 amd64 GStreamer faad plugin from the "bad" set
ii gstreamer1.0-plugins-bad-videoparsers:amd64 1.2.4-1~ubuntu1.1 amd64 GStreamer videoparsers plugin from the "bad" set
ii gstreamer1.0-plugins-base:amd64 1.2.4-1~ubuntu2 amd64 GStreamer plugins from the "base" set
ii gstreamer1.0-plugins-base-apps 1.2.4-1~ubuntu2 amd64 GStreamer helper programs from the "base" set
ii gstreamer1.0-plugins-good:amd64 1.2.4-1~ubuntu1.4 amd64 GStreamer plugins from the "good" set
ii gstreamer1.0-plugins-ugly:amd64 1.2.3-2build1 amd64 GStreamer plugins from the "ugly" set
ii gstreamer1.0-pulseaudio:amd64 1.2.4-1~ubuntu1 amd64 GStreamer plugin for PulseAudio
ii gstreamer1.0-tools 1.2.4-0ubuntu1 amd64 Tools for use with GStreamer
ii gstreamer1.0-x:amd64 1.2.4-1~ubuntu2 amd64 GStreamer plugins for X11 and Pango
ii libgstreamer-plugins-bad0.10-0:amd64 0.10.23-7.2ubuntu1.3 amd64 GStreamer shared libraries from the "bad" set
ii libgstreamer-plugins-bad0.10-dev 0.10.23-7.2ubuntu1.3 amd64 GStreamer development files for libraries from the "bad" set
ii libgstreamer-plugins-bad1.0-0:amd64 1.2.4-1~ubuntu1.1 amd64
ii libgstreamer-plugins-bad1.0-dev 1.2.4-1~ubuntu1.1 amd64
ii libgstreamer-plugins-base0.10-0:amd64 0.10.36-1.1ubuntu2.1 amd64 GStreamer libraries from the "base" set
ii libgstreamer-plugins-base0.10-dev 0.10.36-1.1ubuntu2.1 amd64
ii libgstreamer-plugins-base1.0-0:amd64 1.2.4-1~ubuntu2.1 amd64
ii libgstreamer-plugins-base1.0-dev 1.2.4-1~ubuntu2.1 amd64
ii libgstreamer-plugins-good1.0-0:amd64 1.2.4-1~ubuntu1.4 amd64
ii libgstreamer-plugins-good1.0-dev 1.2.4-1~ubuntu1.4 amd64
ii libgstreamer0.10-0:amd64 0.10.36-1.2ubuntu3 amd64 Core GStreamer libraries and elements
ii libgstreamer0.10-dev 0.10.36-1.2ubuntu3 amd64 GStreamer core development files
ii libgstreamer1.0-0:amd64 1.2.4-0ubuntu1.1 amd64 Core GStreamer libraries and elements
ii libgstreamer1.0-dev 1.2.4-0ubuntu1.1 amd64 GStreamer core development files
ii libreoffice-avmedia-backend-gstreamer 1:4.2.8-0ubuntu4 amd64 GStreamer backend for LibreOffice

red-4you
3rd May 2017, 13:52
Hello,

Gstremer works fine, because when I execute those commandes on the terminal, the video play successfully.

Gst-launch-1.0 -v playbin uri = file: ///home/user/video1/video1.mp4
Gst-launch-0.10 -v playbin uri = file: ///home/user/video1/video1.mp4


also I have a bizarre behavior from QT !! when I delete the .cpp and .h included on my .pro file, (QML) QMediaPlayer can play the video.