简体   繁体   English

python中的视频播放器创建

[英]Video player creation in python

I need to create a widget that will play two synchronized (H264) videos, among other things.我需要创建一个小部件来播放两个同步 (H264) 视频等。 I have never done any GUI stuff before and would like to accomplish my goal with the least amount of work.我以前从未做过任何 GUI 的东西,我想用最少的工作来完成我的目标。 I have two questions:我有两个问题:

  • Do Tkinter or Qt have functionality that allows me play videos synchronously? Tkinter 或 Qt 是否具有允许我同步播放视频的功能?

I have looked at both Tkinter and Qt and it seems there is no easy, built in, way to do so.我已经查看了 Tkinter 和 Qt,似乎没有简单的内置方法可以做到这一点。 But, then again, I am pretty unfamiliar with these systems so I could have overlooked something.但是,话又说回来,我对这些系统非常陌生,所以我可能会忽略一些东西。

I'm not sure on the synchronous video side, but this related post may help understand more about potential limitation regarding video in tkinter我不确定同步视频方面,但这篇相关文章可能有助于更多地了解 tkinter 中视频的潜在限制

Way to play video files in Tkinter? 如何在 Tkinter 中播放视频文件?

Hope this a helpful...gl希望这是一个有用的...gl

Qt lets you play videos using the QVideoWidget and QMediaPlayer. Qt 允许您使用 QVideoWidget 和 QMediaPlayer 播放视频。 There's an example player for PyQt. PyQt 有一个示例播放器

For Tkinter there is no default widget for playing videos.对于 Tkinter,没有用于播放视频的默认小部件。 You can play videos with tkinter, but this is not using one of the tkinter widgets and a bit hackish.您可以使用 tkinter 播放视频,但这不是使用 tkinter 小部件之一,而且有点老套。 See this answer on stackoverflow在stackoverflow上看到这个答案

Synchronizing is tricky with videos, but possible.与视频同步很棘手,但可能。 You would have to set the videos to start at the exact same time, with the same frame rate.您必须将视频设置为在完全相同的时间以相同的帧速率开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PySide / Python视频播放器问题 - PySide/python video player issue 带qt声子的视频播放器(使用python) - video player with qt phonon (using python) 使用PyQT QDialogs的视频播放器(Python) - Video Player using PyQT QDialogs (Python) 在python程序中将PiCamera视频显示到嵌入式视频播放器 - Display PiCamera video to an embedded video player in a python program 如何在python中更改vlc媒体播放器的视频宽高比 - How to change video aspect ratio of vlc media player in python 如何在python TKinter中使用GStreamer调整视频播放器的大小和裁剪? - How to resize and crop in a video player using GStreamer in python TKinter? Kivy Video Player - 视频未加载 - Kivy Video Player - Video not loaded 使用 Python 在同一 window 的方框内播放视频。 视频播放器不应单独打开 window - Using Python play a video within a square frame in the same window. Video player should not be opened in an individual window Python tkinter 的视频播放器,当我暂停视频时,我无法重新播放 - Video player by Python tkinter, When I pause video, I cannot re-play 如何在 pyqt5 中为 windows 创建视频播放器以使用 python 代码播放 mp4? - how to create video player in pyqt5 for windows to play mp4 using python code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM