[英]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:我有两个问题:
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.