Qt Mediaplayer - defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
-
Hello,
I'm trying to build a Qt mediaplayer application on Qt to play few audio files.
But on running the application, I find this warning:defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
player = new QMediaPlayer(this);
player->setMedia(QUrl::fromLocalFile("/home/Music/bensound-anewbeginning.mp3"));
player->setVolume(80);
qDebug() << "AudioStatus: " << player->isAudioAvailable();
player->play();
qDebug()<<"Player Error:" << player->errorString();
qDebug()<<player->mediaStatus();Could you please help if i'm missing something here? Thank you.
-
@Ronak5 Did you install GStreamer plug-in? Also you can set QT_DEBUG_PLUGINS http://doc.qt.io/qt-5/debug.html before starting your app to see which plug-ins are loaded.
-
@jsulm
hi, Thanks for help.
i've installed few gstreamer plugins via commands:
sudo apt-get install gstreamer1.0-plugins-ugly
sudo apt-get install gstreamer1.0-alsaBut still it's not working.
Also, I've set QT_DEBUG_PLUGINS =1. What exactly to look for in the debug logs for qt multimedia?
-
-
@jsulm
Yes I ran my app with that.I can see some of these errors below.
QFactoryLoader::QFactoryLoader() looking at "/home/Qt/5.11.1/gcc_64/plugins/mediaservice/libgstaudiodecoder.so.debug"
"The shared library was not found."
not a pluginQFactoryLoader::QFactoryLoader() looking at "/home/Qt/5.11.1/gcc_64/plugins/mediaservice/libgstcamerabin.so.debug"
"The shared library was not found."
not a pluginQFactoryLoader::QFactoryLoader() looking at "/home/Qt/5.11.1/gcc_64/plugins/mediaservice/libgstmediacapture.so.debug"
"The shared library was not found."
not a pluginQFactoryLoader::QFactoryLoader() looking at "/home/Qt/5.11.1/gcc_64/plugins/mediaservice/libgstmediaplayer.so.debug"
"The shared library was not found."
not a pluginCannot load library /home/Qt/5.11.1/gcc_64/plugins/mediaservice/libgstmediaplayer.so: (/home/Qt/5.11.1/gcc_64/lib/libQt5MultimediaGstTools.so.5: undefined symbol: _gst_value_list_type)
Is there any specific plugins/ commands for plaugins to run?
-
@Ronak5 said in Qt Mediaplayer - defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer":
libgstaudiodecoder.so.debug
This looks strange!
It should be libgstaudiodecoder.so
How did you install Qt?
Are you starting a debug build? It shouldn't make any difference, but you could try to start a release build and see how it behaves then. -
@jsulm
Hey, yea i was building in debug mode. But I couldn't understand why it won't work with debug.
I had built and run in release mode. it isn't working ,but now I don't find above errors.
But I do see error:Got keys from plugin meta data ("gstreamermediaplayer")
QFactoryLoader::QFactoryLoader() checking directory path "/home/build-cluster-Desktop_Qt_5_11_1_GCC_64bit-Release/mediaservice" ...
Cannot load library /home/Qt/5.11.1/gcc_64/plugins/mediaservice/libgstmediaplayer.so: (/home/Qt/5.11.1/gcc_64/lib/libQt5MultimediaGstTools.so.5: undefined symbol: _gst_value_list_type)
QLibraryPrivate::loadPlugin failed on "/home/Qt/5.11.1/gcc_64/plugins/mediaservice/libgstmediaplayer.so" : "Cannot load library /home/Qt/5.11.1/gcc_64/plugins/mediaservice/libgstmediaplayer.so: (/home/Qt/5.11.1/gcc_64/lib/libQt5MultimediaGstTools.so.5: undefined symbol: _gst_value_list_type)"
defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer" -
@Ronak5 I really have no idea what happens if you run a debug build, it should actually work same way.
What I'm wondering about is this path: /home/Qt - is it correct? /home directory contains user home directories. Do you have a user with user name Qt?
Regarding undefined symbol: _gst_value_list_type: doldd /home/Qt/5.11.1/gcc_64/plugins/mediaservice/libgstmediaplayer.so
in a terminal and see whether everything was founf.
-
@jsulm
Hey, yes the path is correct. It's in one of the user home directories. It's just edited by me.Also, regarding ldd /home/Qt/5.11.1/gcc_64/plugins/mediaservice/libgstmediaplayer.so command,
I see all the libs and nothing is not found there.
Also, I just ran config summary for my Qt. What i found is this:Qt Multimedia:
ALSA ................................... no
GStreamer 1.0 .......................... no
GStreamer 0.10 ......................... no
Video for Linux ........................ yes
OpenAL ................................. no
PulseAudio ............................. no
Resource Policy (libresourceqt5) ....... no
Windows Audio Services ................. no
DirectShow ............................. no
Windows Media Foundation ............... noIs this a problem?
-
@Ronak5 said in Qt Mediaplayer - defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer":
GStreamer 1.0 .......................... no
GStreamer 0.10 ......................... noThis is bad. You do not have GStreamer support in your Qt.
You need to install needed GStreamer dev packages, run configure again and build. -