Unsolved How to play the video?
-
@jsulm
You are right. But actually i had read the example already.
But i didn't ask the question properly.
I will rewrite the question. -
@victor-wang On Linux you need GStreamer libraries to play media files.
Also, you can try to start your app with QT_DEBUG_PLUGINS set to 1 to see what is missing. -
@jsulm
First, I have check it and there is a gst-play-1.0 player in my linux+QT.
I think i do have the libarary.Second, sorry for asking this.
Where should i add QT_DEBUG_PLUGINS =1 in my program?
Is it need to be add in .pro file or main.cpp? -
@victor-wang said in How to play the video?:
QT_DEBUG_PLUGINS
its an Environment Variable
Must be set before running Creator
How to do that depends on platform. (win/linux/mac) -
@mrjj
I am on the linux platform and i add this line before the QApplication.qputenv("QT_DEBUG_PLUGINS", QByteArray("1"));
And it is work, i got additional output now.
But still I can't understand why i will get the error.
-
@victor-wang Can you please post the output?
-
@jsulm
Sure, it a little bit long so i just post the place where i got the problem output.Got keys from pluygin meta data ("audiocapture") QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/mediaservice" . . . defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer" QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/bearer" . . . QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/bearer/libconnmanbearer.so" Found metadata in lib /usr/lib/qt5/plugins/bearer/libconnmanbearer.so, metadata= { "IID": "org.qt-project.Qt.QBearerEngineFactoryInterface", "MetaData": { "Keys": [ "connman" ] }, "className": "QConnmanEnginePlugin", "debug": false, "version": 328961 }
This is where the problem show.
defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
What is this problem?
Is the version of GStreamer too old? -
@victor-wang Can you post everything?
-
@jsulm
Sure, i will post all of it.QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/platforms" ... QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/platforms/libqeglfs.so" Found metadata in lib /usr/lib/qt5/plugins/platforms/libqeglfs.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "eglfs" ] }, "className": "QEglFSIntegrationPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("eglfs") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/platforms/libqminimal.so" Found metadata in lib /usr/lib/qt5/plugins/platforms/libqminimal.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "minimal" ] }, "className": "QMinimalIntegrationPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("minimal") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/platforms/libqminimalegl.so" Found metadata in lib /usr/lib/qt5/plugins/platforms/libqminimalegl.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "minimalegl" ] }, "className": "QMinimalEglIntegrationPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("minimalegl") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/platforms/libqoffscreen.so" Found metadata in lib /usr/lib/qt5/plugins/platforms/libqoffscreen.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "offscreen" ] }, "className": "QOffscreenIntegrationPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("offscreen") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/platforms/libqwayland-egl.so" Found metadata in lib /usr/lib/qt5/plugins/platforms/libqwayland-egl.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "wayland-egl" ] }, "className": "QWaylandIntegrationPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("wayland-egl") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/platforms/libqwayland-generic.so" Found metadata in lib /usr/lib/qt5/plugins/platforms/libqwayland-generic.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "wayland" ] }, "className": "QWaylandIntegrationPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("wayland") loaded library "/usr/lib/qt5/plugins/platforms/libqwayland-generic.so" QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/platformthemes" ... QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/styles" ... QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/iconengines" ... QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/iconengines/libqsvgicon.so" Found metadata in lib /usr/lib/qt5/plugins/iconengines/libqsvgicon.so, metadata= { "IID": "org.qt-project.Qt.QIconEngineFactoryInterface", "MetaData": { "Keys": [ "svg", "svgz", "svg.gz" ] }, "className": "QSvgIconPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("svg", "svgz", "svg.gz") QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/imageformats" ... QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/imageformats/libqdds.so" Found metadata in lib /usr/lib/qt5/plugins/imageformats/libqdds.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "dds" ], "MimeTypes": [ "image/x-dds" ] }, "className": "QDDSPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("dds") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/imageformats/libqgif.so" Found metadata in lib /usr/lib/qt5/plugins/imageformats/libqgif.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "gif" ], "MimeTypes": [ "image/gif" ] }, "className": "QGifPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("gif") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/imageformats/libqicns.so" Found metadata in lib /usr/lib/qt5/plugins/imageformats/libqicns.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "icns" ], "MimeTypes": [ "image/x-icns" ] }, "className": "QICNSPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("icns") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/imageformats/libqico.so" Found metadata in lib /usr/lib/qt5/plugins/imageformats/libqico.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "ico", "cur" ], "MimeTypes": [ "image/vnd.microsoft.icon" ] }, "className": "QICOPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("ico", "cur") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/imageformats/libqjp2.so" Found metadata in lib /usr/lib/qt5/plugins/imageformats/libqjp2.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "jp2" ], "MimeTypes": [ "image/jp2", "image/jpx", "image/jpm", "video/mj2" ] }, "className": "QJp2Plugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("jp2") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/imageformats/libqjpeg.so" Found metadata in lib /usr/lib/qt5/plugins/imageformats/libqjpeg.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "jpg", "jpeg" ], "MimeTypes": [ "image/jpeg", "image/jpeg" ] }, "className": "QJpegPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("jpg", "jpeg") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/imageformats/libqmng.so" Found metadata in lib /usr/lib/qt5/plugins/imageformats/libqmng.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "mng" ], "MimeTypes": [ "image/x-mng" ] }, "className": "QMngPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("mng") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/imageformats/libqsvg.so" Found metadata in lib /usr/lib/qt5/plugins/imageformats/libqsvg.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "svg", "svgz" ], "MimeTypes": [ "image/svg+xml" ] }, "className": "QSvgPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("svg", "svgz") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/imageformats/libqtga.so" Found metadata in lib /usr/lib/qt5/plugins/imageformats/libqtga.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "tga" ], "MimeTypes": [ "image/x-tga" ] }, "className": "QTgaPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("tga") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/imageformats/libqtiff.so" Found metadata in lib /usr/lib/qt5/plugins/imageformats/libqtiff.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "tiff", "tif" ], "MimeTypes": [ "image/tiff", "image/tiff" ] }, "className": "QTiffPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("tiff", "tif") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/imageformats/libqwbmp.so" Found metadata in lib /usr/lib/qt5/plugins/imageformats/libqwbmp.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "wbmp" ], "MimeTypes": [ "image/vnd.wap.wbmp" ] }, "className": "QWbmpPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("wbmp") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/imageformats/libqwebp.so" Found metadata in lib /usr/lib/qt5/plugins/imageformats/libqwebp.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "webp" ], "MimeTypes": [ "image/webp" ] }, "className": "QWebpPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("webp") loaded library "/usr/lib/qt5/plugins/imageformats/libqdds.so" loaded library "/usr/lib/qt5/plugins/imageformats/libqgif.so" loaded library "/usr/lib/qt5/plugins/imageformats/libqicns.so" loaded library "/usr/lib/qt5/plugins/imageformats/libqico.so" loaded library "/usr/lib/qt5/plugins/imageformats/libqjp2.so" loaded library "/usr/lib/qt5/plugins/imageformats/libqjpeg.so" loaded library "/usr/lib/qt5/plugins/imageformats/libqmng.so" loaded library "/usr/lib/qt5/plugins/imageformats/libqsvg.so" loaded library "/usr/lib/qt5/plugins/imageformats/libqtga.so" loaded library "/usr/lib/qt5/plugins/imageformats/libqtiff.so" loaded library "/usr/lib/qt5/plugins/imageformats/libqwbmp.so" loaded library "/usr/lib/qt5/plugins/imageformats/libqwebp.so" flexcan 2090000.flexcan can0: writing ctrl=0x13292005 IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready "Cannot find device \"can1\"\n2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10\n link/can promiscuity 0 \n can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0 \n\t bitrate 100000 sample-point 0.866 \n\t tq 666 prop-seg 6 phase-seg1 6 phase-seg2 2 sjw 1\n\t flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1\n\t clock 30000000\n\t re-started bus-errors arbit-lost error-warn error-pass bus-off\n\t 0 0 0 0 0 0 \n RX: bytes packets errors dropped overrun mcast \n 0 0 0 0 0 0 \n TX: bytes packets errors dropped carrier collsns \n 0 0 0 0 0 0 \nDevice \"can1\" does not exist.\ncannot stop can1Cannot bitrate can1" QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/wayland-graphics-integration-client" ... QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/wayland-graphics-integration-client/libdrm-egl-server.so" Found metadata in lib /usr/lib/qt5/plugins/wayland-graphics-integration-client/libdrm-egl-server.so, metadata= { "IID": "org.qt-project.Qt.WaylandClient.QWaylandServerBufferIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "drm-egl-server" ] }, "className": "DrmEglServerBufferPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data () QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/wayland-graphics-integration-client/libwayland-egl.so" Found metadata in lib /usr/lib/qt5/plugins/wayland-graphics-integration-client/libwayland-egl.so, metadata= { "IID": "org.qt-project.Qt.WaylandClient.QWaylandClientBufferIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "wayland-egl" ] }, "className": "QWaylandEglClientBufferPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("wayland-egl") loaded library "/usr/lib/qt5/plugins/wayland-graphics-integration-client/libwayland-egl.so" Using Wayland-EGL QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/accessiblebridge" ... QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/wayland-decoration-client" ... QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/wayland-decoration-client/libbradient.so" Found metadata in lib /usr/lib/qt5/plugins/wayland-decoration-client/libbradient.so, metadata= { "IID": "org.qt-project.Qt.WaylandClient.QWaylandDecorationFactoryInterface.5.4", "MetaData": { "Keys": [ "bradient" ] }, "className": "QWaylandBradientDecorationPlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("bradient") loaded library "/usr/lib/qt5/plugins/wayland-decoration-client/libbradient.so" QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/mediaservice" ... QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/mediaservice/libqtmedia_audioengine.so" Found metadata in lib /usr/lib/qt5/plugins/mediaservice/libqtmedia_audioengine.so, metadata= { "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0", "MetaData": { "Keys": [ "audiocapture" ], "Services": [ "org.qt-project.qt.audiosource" ] }, "className": "AudioCaptureServicePlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("audiocapture") defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer" QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/bearer" ... QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/bearer/libconnmanbearer.so" Found metadata in lib /usr/lib/qt5/plugins/bearer/libconnmanbearer.so, metadata= { "IID": "org.qt-project.Qt.QBearerEngineFactoryInterface", "MetaData": { "Keys": [ "connman" ] }, "className": "QConnmanEnginePlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("connman") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/bearer/libqconnmanbearer.so" Found metadata in lib /usr/lib/qt5/plugins/bearer/libqconnmanbearer.so, metadata= { "IID": "org.qt-project.Qt.QBearerEngineFactoryInterface", "MetaData": { "Keys": [ "connman" ] }, "className": "QConnmanEnginePlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("connman") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/bearer/libqgenericbearer.so" Found metadata in lib /usr/lib/qt5/plugins/bearer/libqgenericbearer.so, metadata= { "IID": "org.qt-project.Qt.QBearerEngineFactoryInterface", "MetaData": { "Keys": [ "generic" ] }, "className": "QGenericEnginePlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("generic") QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt5/plugins/bearer/libqnmbearer.so" Found metadata in lib /usr/lib/qt5/plugins/bearer/libqnmbearer.so, metadata= { "IID": "org.qt-project.Qt.QBearerEngineFactoryInterface", "MetaData": { "Keys": [ "networkmanager" ] }, "className": "QNetworkManagerEnginePlugin", "debug": false, "version": 328961 } Got keys from plugin meta data ("networkmanager") loaded library "/usr/lib/qt5/plugins/bearer/libconnmanbearer.so" loaded library "libdbus-1" loaded library "/usr/lib/qt5/plugins/bearer/libqgenericbearer.so" loaded library "/usr/lib/qt5/plugins/bearer/libqnmbearer.so"
Here is all the debug output.
-
@victor-wang Can you do
ldd PATH_TO_YOUR_QT/gcc_64/plugins/mediaservice/libgstmediaplayer.so
and post the output?
-
@jsulm
I did not have libgstmediaplayer.so this file.
And i have no ldd commend in my Linux+QT. -
@victor-wang You don't have libgstmediaplayer.so? How did you install Qt? Without this plug-in you will not be able to play media files!
I'm sure you have ldd on your machine, it is usually installed by default (package libc-bin on Ubuntu). -
@jsulm
But i have got this in my machine.
usr/lib/qt5/plugins/mediaservice/libqtmedia_audioengine.so -
@victor-wang This is for audio as the file name says. You want to play video, right?
-
@jsulm
Yes, I want to play video.
But i can play my video vy this commend "gst-play-1.0 /home/video.avi" -
@jsulm
I'm using Yocto project to build the rootfs and all the image contents u-boot kernel . . .
And i'm using Yocto project on Ubuntu to build Linux+QT image for my platform. -
@victor-wang When I guess you did not build libgstmediaplayer.so plug-in.
-
gstreamer :0.10.36-r2 gstreamer1.0 :1.6.0-r0 gstreamer1.0-meta-base :1.0-r0 gstreamer1.0-plugins-bad :1.6.0-r0 gstreamer1.0-plugins-base :1.6.0-r0 gstreamer1.0-plugins-good :1.6.0-r0 gstreamer1.0-plugins-imx :0.12.0-r0 gstreamer1.0-rtsp-server :1.6.0-r0
Which one i should do bitbake?
I had already do:
gstreamer :0.10.36-r2 gstreamer1.0 :1.6.0-r0 gstreamer1.0-plugins-good :1.6.0-r0 gstreamer1.0-rtsp-server :1.6.0-r0
Do i have to build all of it?
-
@victor-wang Not GStreamer is missing but the Qt plug-in libgstmediaplayer.so.
Which GStreamer plug-ins to build depends on the media files you want to play, so I don't know which you need. -
@jsulm
What if i need to play .avi file?
which one i should build?I think libgstmediaplayer.so is in one of them.