Unsolved QMediaPlayer doesn't play anything on Ubuntu 14.04/ Qt 5.7
-
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.
Also when I comment all class on my .pro file, and I kept only the main.cpp file. the Qmediaplayer wroks !!!
I'm using Qthread in 3 class :
controler.cpp
httprequestworker.cpp
opencvworker.cpp.pro file :
TEMPLATE = app QT += core gui multimedia qml quick widgets serialport printsupport sql CONFIG += c++11 extserialport LIBS += -L/usr/local/lib -lPISCAN -lm -lpng -ljpeg -lopencv_videoio -lopencv_core -lopencv_imgcodecs -lopencv_imgproc -lopencv_objdetect -lopencv_highgui INCLUDEPATH += /usr/local/include/opencv DESTDIR = runFiles #seial lib include(/home/qextserialport-master/src/qextserialport.pri) SOURCES += main.cpp \ scanidcard.cpp \ print.cpp \ serialcom.cpp \ smartphoneexract.cpp \ restapi.cpp \ barcode.cpp \ imgprocessing.cpp \ dbmanager.cpp \ dbrun.cpp \ ocr.cpp \ controler.cpp \ config.cpp \ diagnostic.cpp \ validator.cpp \ httprequestworker.cpp \ camera.cpp \ opencvworker.cpp \ extract.cpp RESOURCES += qml.qrc \ externalresources.qrc # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = # Default rules for deployment. include(deployment.pri) DISTFILES += \ HEADERS += \ types.h \ PIScan.h \ scanidcard.h \ print.h \ serialcom.h \ smartphoneexract.h \ restapi.h \ barcode.h \ ocr.h \ imgprocessing.h \ dbmanager.h \ dbrun.h \ controler.h \ config.h \ diagnostic.h \ validator.h \ main.h \ httprequestworker.h \ camera.h \ opencvworker.h \ extract.h
#### 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(); [B] contrInst.start(); // thread[/B] 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); [B] engine.rootContext()->setContextProperty("ProvedorImagem", camInstMain); engine.addImageProvider("provedor", camInstMain);[/B] engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec(); }
Error :
(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