PyQt5 QMediaPlayer defaultServiceProvider :: requestService (): Kein Dienst für "org.qt-project.qt.mediaplayer" gefunden

645
yasuo

Ich verwende Fedora 28. Ich versuche, diesen Code auszuführen

from PyQt5.QtCore import QCoreApplication, QUrl from PyQt5.QtMultimedia import QMediaContent, QMediaPlayer from PyQt5.QtWidgets import QApplication import sys import os   def handle_state_change(state): if state == QMediaPlayer.LoadingMedia: print('loading') if state == QMediaPlayer.LoadedMedia: print('loading finished') player.play() if state == QMediaPlayer.EndOfMedia: print('playing finished') QCoreApplication.quit()   app = QApplication(sys.argv)  url = QUrl.fromLocalFile(os.path.abspath('./redalert.mp3'))  content = QMediaContent(url) player = QMediaPlayer() player.mediaStatusChanged.connect(handle_state_change) player.setVolume(50) player.setMedia(content)  app.exec() 

Es wird jedoch dieser Fehler ausgegeben

Got keys from plugin meta data ("gstreamermediaplayer") QFactoryLoader::QFactoryLoader() checking directory path "/home/ziggs/PycharmProjects/mozart/venv/bin/mediaservice" ... Cannot load library /home/ziggs/PycharmProjects/mozart/venv/lib/python3.6/site-packages/PyQt5/Qt/plugins/mediaservice/libgstmediaplayer.so: (/lib64/libQt5MultimediaGstTools.so.5: version `Qt_5_PRIVATE_API' not found (required by /home/ziggs/PycharmProjects/mozart/venv/lib/python3.6/site-packages/PyQt5/Qt/plugins/mediaservice/libgstmediaplayer.so)) QLibraryPrivate::loadPlugin failed on "/home/ziggs/PycharmProjects/mozart/venv/lib/python3.6/site-packages/PyQt5/Qt/plugins/mediaservice/libgstmediaplayer.so" : "Cannot load library /home/ziggs/PycharmProjects/mozart/venv/lib/python3.6/site-packages/PyQt5/Qt/plugins/mediaservice/libgstmediaplayer.so: (/lib64/libQt5MultimediaGstTools.so.5: version `Qt_5_PRIVATE_API' not found (required by /home/ziggs/PycharmProjects/mozart/venv/lib/python3.6/site-packages/PyQt5/Qt/plugins/mediaservice/libgstmediaplayer.so))" defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer" 

Ich habe den Fehler gegoogelt und versucht, die entsprechenden Plugins zu installieren

dnf list qt5-qtmultimedia gstreamer-plugins-ugly Letzte Prüfung auf abgelaufene Metadaten: vor 0:45:12 am Mo 18 Jun 2018 21:42:00 CEST. Installierte Pakete gstreamer-plugins-ugly.x86_64 0.10.19-27.fc28 @rpmfusion-free qt5-qtmultimedia.x86_64 5.10.1-1.fc28 @anaconda  Verfügbare Pakete gstreamer-plugins-ugly.i686 0.10.19-27.fc28 rpmfusion-free  qt5-qtmultimedia.i686 5.10.1-1.fc28 fedora  
0

0 Antworten auf die Frage