![PyQt5 中哪个 Gstreamer?](https://linux22.com/image/1156443/PyQt5%20%E4%B8%AD%E5%93%AA%E4%B8%AA%20Gstreamer%EF%BC%9F.png)
在 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 FILEPATH
。是否有可能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]
答案1
问题是我为 Python3 安装了两个版本的PyQt5
和sip
。一个在/usr/lib/python3/dist-packages/
,另一个在~/.local/lib/python3.6/site-pacages/
。完全删除.local
版本有帮助。
就是这样,并安装我能找到的所有内容gstreamer
。