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.


  • Qt Champions 2018

    @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-alsa

    But 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?


  • Qt Champions 2018

    @Ronak5 After setting QT_DEBUG_PLUGINS run your app and see the output in the console. It should show which plug-ins are loaded and which are not loaded because of errors. Check everything related to multimedia plug-ins.



  • @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 plugin

    QFactoryLoader::QFactoryLoader() looking at "/home/Qt/5.11.1/gcc_64/plugins/mediaservice/libgstcamerabin.so.debug"
    "The shared library was not found."
    not a plugin

    QFactoryLoader::QFactoryLoader() looking at "/home/Qt/5.11.1/gcc_64/plugins/mediaservice/libgstmediacapture.so.debug"
    "The shared library was not found."
    not a plugin

    QFactoryLoader::QFactoryLoader() looking at "/home/Qt/5.11.1/gcc_64/plugins/mediaservice/libgstmediaplayer.so.debug"
    "The shared library was not found."
    not a plugin

    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)

    Is there any specific plugins/ commands for plaugins to run?


  • Qt Champions 2018

    @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"


  • Qt Champions 2018

    @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: do

    ldd /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 ............... no

    Is this a problem?


  • Qt Champions 2018

    @Ronak5 said in Qt Mediaplayer - defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer":

    GStreamer 1.0 .......................... no
    GStreamer 0.10 ......................... no

    This is bad. You do not have GStreamer support in your Qt.
    You need to install needed GStreamer dev packages, run configure again and build.



  • @jsulm
    Oh. I had installed Gstreamer packages using sudo apt-get commands.
    But what command should i run for configure again ? And by build do you mean Qmake/build complete Qt app?
    Sorry I'm new to Qt so have to ask basics.


  • Qt Champions 2018

    @Ronak5 You need to install GStreamer -dev packages using apt-get.
    I think you can then run configure in the same way you did it before, but only build qtmultimedia modules (qmake, make, make install).



  • @jsulm
    hey, yes i've updated my ubuntu from 14.04 LTS to 16.04 now. And installed gstreamer related packages.
    But now I'm not able to build/make qtmultimedia. Could you please help on it?
    Thanks a lot for your support here. Thank you.


  • Qt Champions 2018

    @Ronak5 You should say what is not working.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.