如何在PYQT媒体播放器中加入houndypy?
我正在Python 3和Pyqt5中开发视频编辑器。我想将QMediaPlayer Widget和Qvideowidget与Hoypy一起使用。我尝试使用以下代码来播放视频:
self.mediaPlayer = QMediaPlayer(None, QMediaPlayer.VideoSurface).setMedia(QMediaContent(VideoFileClip('aaaspain.mp4')))
但是它返回了我的错误:
TypeError: arguments did not match any overloaded call:
QMediaContent(): too many arguments
QMediaContent(QUrl): argument 1 has unexpected type 'VideoFileClip'
QMediaContent(QNetworkRequest): argument 1 has unexpected type 'VideoFileClip'
QMediaContent(QMediaResource): argument 1 has unexpected type 'VideoFileClip'
QMediaContent(Iterable[QMediaResource]): argument 1 has unexpected type 'VideoFileClip'
QMediaContent(QMediaContent): argument 1 has unexpected type 'VideoFileClip'
QMediaContent(QMediaPlaylist, contentUrl: QUrl = QUrl()): argument 1 has unexpected type 'VideoFileClip'
我正在使用Ubuntu 20.04.2和Python 3.8.10。
I am developing a video editor in python 3 and PyQt5. I would like to use the QMediaPlayer widget and QVideoWidget together with moviepy. I tried with the following line of code to play a video:
self.mediaPlayer = QMediaPlayer(None, QMediaPlayer.VideoSurface).setMedia(QMediaContent(VideoFileClip('aaaspain.mp4')))
but it returns me this error:
TypeError: arguments did not match any overloaded call:
QMediaContent(): too many arguments
QMediaContent(QUrl): argument 1 has unexpected type 'VideoFileClip'
QMediaContent(QNetworkRequest): argument 1 has unexpected type 'VideoFileClip'
QMediaContent(QMediaResource): argument 1 has unexpected type 'VideoFileClip'
QMediaContent(Iterable[QMediaResource]): argument 1 has unexpected type 'VideoFileClip'
QMediaContent(QMediaContent): argument 1 has unexpected type 'VideoFileClip'
QMediaContent(QMediaPlaylist, contentUrl: QUrl = QUrl()): argument 1 has unexpected type 'VideoFileClip'
I am working on Ubuntu 20.04.2 and python 3.8.10.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论