Python PyQt5中的哪个Gstreamer?

Python PyQt5中的哪个Gstreamer?,python,ubuntu,qt5,pyqt5,gstreamer,Python,Ubuntu,Qt5,Pyqt5,Gstreamer,在Ubuntu 16.04和18.04上,每当我尝试使用QMediaPlayer时,我都会收到没有服务的提示 >>> from PyQt5 import QtMultimedia >>> qtm = QtMultimedia.QMediaPlayer() defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer" 互联网建议安

在Ubuntu 16.04和18.04上,每当我尝试使用
QMediaPlayer
时,我都会收到没有服务的提示

>>> from PyQt5 import QtMultimedia
>>> qtm = QtMultimedia.QMediaPlayer()
defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
互联网建议安装一些Gstreamer软件包,但没有说明是哪个。我怎样才能知道需要哪个软件包

看起来Ubuntu默认附带了
Gstreamer1.0
,我可以运行
gst-play-1.0文件路径。是否需要安装
gstreamer-0.10
?如何设置反向依赖关系

我安装的软件包

notlaptop@laptop$ apt list --installed | grep gstream*    
gir1.2-gstreamer-1.0/bionic,now 1.14.0-1 amd64 [installed]
gstreamer1.0-alsa/bionic,now 1.14.0-2ubuntu1 amd64 [installed]
gstreamer1.0-clutter-3.0/bionic,now 3.0.26-1 amd64 [installed]
gstreamer1.0-gl/bionic,now 1.14.0-2ubuntu1 amd64 [installed]
gstreamer1.0-packagekit/bionic,now 1.1.9-1ubuntu2 amd64 [installed]
gstreamer1.0-plugins-bad/bionic,now 1.14.0-1ubuntu1 amd64 [installed]
gstreamer1.0-plugins-base/bionic,now 1.14.0-2ubuntu1 amd64 [installed]
gstreamer1.0-plugins-base-apps/bionic,now 1.14.0-2ubuntu1 amd64 [installed]
gstreamer1.0-plugins-good/bionic,now 1.14.0-1ubuntu1 amd64 [installed]
gstreamer1.0-pulseaudio/bionic,now 1.14.0-1ubuntu1 amd64 [installed]
gstreamer1.0-qt5/bionic,now 1.14.0-1ubuntu1 amd64 [installed]
gstreamer1.0-tools/bionic,now 1.14.0-1 amd64 [installed]
gstreamer1.0-x/bionic,now 1.14.0-2ubuntu1 amd64 [installed]
libgstreamer-gl1.0-0/bionic,now 1.14.0-2ubuntu1 amd64 [installed]
libgstreamer-opencv1.0-0/bionic,now 1.14.0-1ubuntu1 amd64 [installed,automatic]
libgstreamer-plugins-bad1.0-0/bionic,now 1.14.0-1ubuntu1 amd64 [installed,automatic]
libgstreamer-plugins-bad1.0-dev/bionic,now 1.14.0-1ubuntu1 amd64 [installed]
libgstreamer-plugins-base1.0-0/bionic,now 1.14.0-2ubuntu1 amd64 [installed]
libgstreamer-plugins-base1.0-dev/bionic,now 1.14.0-2ubuntu1 amd64 [installed]
libgstreamer-plugins-good1.0-0/bionic,now 1.14.0-1ubuntu1 amd64 [installed]
libgstreamer-plugins-good1.0-dev/bionic,now 1.14.0-1ubuntu1 amd64 [installed]
libgstreamer1.0-0/bionic,now 1.14.0-1 amd64 [installed]
libgstreamer1.0-dev/bionic,now 1.14.0-1 amd64 [installed]
libreoffice-avmedia-backend-gstreamer/bionic,now 1:6.0.3-0ubuntu1 amd64 [installed]

我设法解决了这个问题,安装了几乎所有我能找到的与
gstream
qtmedia
远程连接的设备。我不确定哪些是必要的,但当前列表如下

为了进行测试,最好清理缓存的python可执行文件,这样它就不会使用旧版本。这不仅在同一目录中,而且在
~/.local/lib/python3.6/site-packages/

这个软件包蛋糕上的樱桃是
libqt5multimedia5插件

gstream的安装列表

$ apt list --installed | grep gstream
gir1.2-gstreamer-1.0/bionic-updates,now 1.14.1-1~ubuntu18.04.1 amd64 [installed]
gstreamer-qapt/bionic,now 3.0.4-0ubuntu1 amd64 [installed,automatic]
gstreamer0.10-qapt/bionic,bionic,now 3.0.4-0ubuntu1 all [installed]
gstreamer1.0-alsa/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
gstreamer1.0-clutter-3.0/bionic,now 3.0.26-1 amd64 [installed]
gstreamer1.0-espeak/bionic,now 0.4.0-3 amd64 [installed]
gstreamer1.0-fluendo-mp3/bionic,now 0.10.32.debian-1 amd64 [installed,automatic]
gstreamer1.0-gl/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
gstreamer1.0-libav/bionic-updates,now 1.14.1-1~ubuntu18.04.1 amd64 [installed,automatic]
gstreamer1.0-nice/bionic,now 0.1.14-1 amd64 [installed]
gstreamer1.0-packagekit/bionic,now 1.1.9-1ubuntu2 amd64 [installed]
gstreamer1.0-plugins-bad/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
gstreamer1.0-plugins-base/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
gstreamer1.0-plugins-base-apps/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
gstreamer1.0-plugins-good/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
gstreamer1.0-plugins-ugly/bionic-updates,now 1.14.1-1~ubuntu18.04.1 amd64 [installed]
gstreamer1.0-pulseaudio/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
gstreamer1.0-qt5/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
gstreamer1.0-tools/bionic-updates,now 1.14.1-1~ubuntu18.04.1 amd64 [installed]
gstreamer1.0-vaapi/bionic-updates,now 1.14.1-1~ubuntu18.04.1 amd64 [installed,automatic]
gstreamer1.0-x/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
libgstreamer-gl1.0-0/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
libgstreamer-opencv1.0-0/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed,automatic]
libgstreamer-plugins-bad1.0-0/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
libgstreamer-plugins-bad1.0-dev/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
libgstreamer-plugins-base1.0-0/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
libgstreamer-plugins-base1.0-dev/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
libgstreamer-plugins-good1.0-0/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
libgstreamer-plugins-good1.0-dev/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
libgstreamer1.0-0/bionic-updates,now 1.14.1-1~ubuntu18.04.1 amd64 [installed]
libgstreamer1.0-dev/bionic-updates,now 1.14.1-1~ubuntu18.04.1 amd64 [installed]
libgstreamerd-3-0/bionic,now 3.7.5-2build1 amd64 [installed]
libgstreamerd-3-dev/bionic,now 3.7.5-2build1 amd64 [installed]
libgstreamermm-1.0-1/bionic,now 1.10.0+dfsg-1 amd64 [installed,automatic]
libgstreamermm-1.0-dev/bionic,now 1.10.0+dfsg-1 amd64 [installed]
libqt5gstreamer-1.0-0/bionic,now 1.2.0-5 amd64 [installed]
libqt5gstreamer-dev/bionic,now 1.2.0-5 amd64 [installed]
libqt5gstreamerquick-1.0-0/bionic,now 1.2.0-5 amd64 [installed]
libqt5gstreamerui-1.0-0/bionic,now 1.2.0-5 amd64 [installed]
libqt5gstreamerutils-1.0-0/bionic,now 1.2.0-5 amd64 [installed]
libreoffice-avmedia-backend-gstreamer/bionic,now 1:6.0.3-0ubuntu1 amd64 [installed]
qml-module-qtgstreamer/bionic,now 1.2.0-5 amd64 [installed,automatic]
qtgstreamer-plugins-qt5/bionic,now 1.2.0-5 amd64 [installed]
和fotqt5

$ apt list --installed | grep qt5
gstreamer1.0-qt5/bionic-updates,now 1.14.1-1ubuntu1~ubuntu18.04.1 amd64 [installed]
libdbusmenu-qt5-2/bionic,now 0.9.3+16.04.20160218-1ubuntu1 amd64 [installed,automatic]
libphonon4qt5-4/bionic,now 4:4.10.0-2 amd64 [installed,automatic]
libpolkit-qt5-1-1/bionic,now 0.112.0-5 amd64 [installed,automatic]
libqt5concurrent5/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5core5a/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5dbus5/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5designer5/bionic,now 5.9.5-0ubuntu1 amd64 [installed,automatic]
libqt5glib-2.0-0/bionic,now 1.2.0-5 amd64 [installed]
libqt5gstreamer-1.0-0/bionic,now 1.2.0-5 amd64 [installed]
libqt5gstreamer-dev/bionic,now 1.2.0-5 amd64 [installed]
libqt5gstreamerquick-1.0-0/bionic,now 1.2.0-5 amd64 [installed]
libqt5gstreamerui-1.0-0/bionic,now 1.2.0-5 amd64 [installed]
libqt5gstreamerutils-1.0-0/bionic,now 1.2.0-5 amd64 [installed]
libqt5gui5/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed]
libqt5help5/bionic,now 5.9.5-0ubuntu1 amd64 [installed,automatic]
libqt5multimedia5/bionic,now 5.9.5-0ubuntu1 amd64 [installed,automatic]
libqt5multimedia5-plugins/bionic,now 5.9.5-0ubuntu1 amd64 [installed]
libqt5multimediawidgets5/bionic,now 5.9.5-0ubuntu1 amd64 [installed,automatic]
libqt5network5/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5opengl5/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5opengl5-dev/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5printsupport5/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5qml5/bionic,now 5.9.5-0ubuntu1 amd64 [installed,automatic]
libqt5quick5/bionic,now 5.9.5-0ubuntu1 amd64 [installed,automatic]
libqt5script5/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5sql5/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5sql5-sqlite/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5svg5/bionic,now 5.9.5-0ubuntu1 amd64 [installed,automatic]
libqt5test5/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5texttospeech5/bionic,now 5.9.5-0ubuntu1 amd64 [installed,automatic]
libqt5waylandclient5/bionic,now 5.9.5-0ubuntu1 amd64 [installed,automatic]
libqt5waylandcompositor5/bionic,now 5.9.5-0ubuntu1 amd64 [installed,automatic]
libqt5widgets5/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5x11extras5/bionic,now 5.9.5-0ubuntu1 amd64 [installed,automatic]
libqt5xml5/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
phonon4qt5/bionic,now 4:4.10.0-2 amd64 [installed,automatic]
phonon4qt5-backend-vlc/bionic,now 0.10.1-2 amd64 [installed,automatic]
pyqt5-dev/bionic,bionic,now 5.10.1+dfsg-1ubuntu2 all [installed]
pyqt5-examples/bionic,bionic,now 5.10.1+dfsg-1ubuntu2 all [installed]
python-pyqt5/bionic,now 5.10.1+dfsg-1ubuntu2 amd64 [installed]
python-pyqt5.qtmultimedia/bionic,now 5.10.1+dfsg-1ubuntu2 amd64 [installed]
python3-pyqt5/bionic,now 5.10.1+dfsg-1ubuntu2 amd64 [installed]
python3-pyqt5-dbg/bionic,now 5.10.1+dfsg-1ubuntu2 amd64 [installed,automatic]
python3-pyqt5.qtmultimedia/bionic,now 5.10.1+dfsg-1ubuntu2 amd64 [installed]
python3-pyqt5.qtmultimedia-dbg/bionic,now 5.10.1+dfsg-1ubuntu2 amd64 [installed]
qt5-gtk-platformtheme/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
qt5-qmake/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
qt5-qmake-bin/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed,automatic]
qtgstreamer-plugins-qt5/bionic,now 1.2.0-5 amd64 [installed]

如果您使用的是Qt5.10,则可以降级到5.8,或将plugins/mediaservice/中的文件替换为旧版本。这对我来说很有用。

诚实地说,这可能是重复的,我不知道为什么会有负面影响。我知道这个问题已经被问过很多次了,但我发现没有什么是有效的。我以前安装过所有插件,但都不起作用。必须删除它们。安装
libgstreamer-plugins-base1.0-dev
package您必须安装这些软件包,但如果终止
-dev
,这些软件包是为开发人员准备的。忘记堆栈溢出会有多毒。我猜人们认为这是一个与Ubuntu相关的问题,而不是编程。我将提出这个问题。