Important: Please read the Qt Code of Conduct -

The QMediaPlayer Object Does not have a valid service.

  • Ubuntu 14.04x64, Qt 5.9.3

    My .pro has QT += qml quick multimedia.
    My QML contains:

    Video { id:vid; source:"file:///home/phrogz/video.mp4"; autoPlay:true }
    Text  { text:vid.errorString }

    I see the error message "The QMediaPlayer Object Does not have a valid service."

    The video is present and valid. The same code works on another developer's machine.

    Based on other threads found online I've installed gstreamer0.10-ffmpeg, gstreamer1.0-libav, and gstreamer-tools, with no improvement in my problem.
    (Edit: also tried adding libgstreamer1.0-0 and libgstreamer1.0-dev)

    This related thread merely concludes with the developer upgrading Qt and having the problem go away.

    Can anyone shed light on what this error means, and (more importantly) how I can fix it?


    Edit: the only multimedia references during build come in the last few lines of the build process:

    g++ -c -pipe -D_GLIBCXX_USE_CXX11_ABI=0 -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_QUICK_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/home/phrogz/vidtest -I. -I/home/phrogz/Qt/5.9.3/gcc_64/include -I/home/phrogz/Qt/5.9.3/gcc_64/include/QtQuick -I/home/phrogz/Qt/5.9.3/gcc_64/include/QtMultimedia -I/home/phrogz/Qt/5.9.3/gcc_64/include/QtGui -I/home/phrogz/Qt/5.9.3/gcc_64/include/QtQml -I/home/phrogz/Qt/5.9.3/gcc_64/include/QtNetwork -I/home/phrogz/Qt/5.9.3/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I/home/phrogz/Qt/5.9.3/gcc_64/mkspecs/linux-g++ -o main.o /home/phrogz/vidtest/main.cpp
    /home/phrogz/Qt/5.9.3/gcc_64/bin/rcc -name qml /home/phrogz/vidtest/qml.qrc -o qrc_qml.cpp
    g++ -c -pipe -D_GLIBCXX_USE_CXX11_ABI=0 -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_QUICK_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/home/phrogz/vidtest -I. -I/home/phrogz/Qt/5.9.3/gcc_64/include -I/home/phrogz/Qt/5.9.3/gcc_64/include/QtQuick -I/home/phrogz/Qt/5.9.3/gcc_64/include/QtMultimedia -I/home/phrogz/Qt/5.9.3/gcc_64/include/QtGui -I/home/phrogz/Qt/5.9.3/gcc_64/include/QtQml -I/home/phrogz/Qt/5.9.3/gcc_64/include/QtNetwork -I/home/phrogz/Qt/5.9.3/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I/home/phrogz/Qt/5.9.3/gcc_64/mkspecs/linux-g++ -o qrc_qml.o qrc_qml.cpp
    g++ -Wl,-rpath,/home/phrogz/Qt/5.9.3/gcc_64/lib -o vidtest main.o qrc_qml.o   -L/home/phrogz/Qt/5.9.3/gcc_64/lib -lQt5Quick -lQt5Multimedia -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGL -lpthread 

  • I'm sorry to say that I "solved" this by upgrading from Ubuntu 14.04 to 16.04. It was something I had to do for other reasons, and this problem got fixed in the process.

    As a clue to others, there was a runtime notice about not being able to open a linenoise directory in /tmp/, so maybe that was the problem?

    Edit: Ignore the previous paragraph; the error message copied below still occurs on 16.04, but the MediaPlayer problem is still fixed, so that is not a useful hint to source the problem.

    ** (vidtest:6971): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-te0VxRDHRD: Connection refused

Log in to reply