PyQt5 - 无法使用QVideoWidget播放视频

时间:2016-07-03 13:43:56

标签: python linux gstreamer pyqt5

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的编解码器。

0 个答案:

没有答案
相关问题