from PyQt5.QtWidgets import *
from PyQt5.QtMultimedia import *
from PyQt5.QtMultimediaWidgets import *
from PyQt5.QtCore import *
import sys
app = QApplication(sys.argv)
w = QVideoWidget()
w.resize(300, 300)
w.move(0, 0)
w.show()
player = QMediaPlayer()
player.setMedia(QMediaContent(QUrl.fromLocalFile("/home/doflamingo /Documents/Nisemono/got.avi")))
player.setVideoOutput(w)
player.play()
sys.exit(app.exec_())
这个非常简单的代码在ArchLinux上提供以下输出:
GStreamer; Unable to pause - "file:///home/doflamingo/Documents/Nisemono/got.avi"
GStreamer; Unable to pause - "file:///home/doflamingo/Documents/Nisemono/got.avi"
一切似乎都是最新的,并且安装了GStreamer的编解码器。