Python 视频框架
我正在寻找一个 Python 框架,它将使我能够播放视频并在该视频上绘图(用于标记目的)。
我尝试过 Pyglet,但这似乎效果不是特别好 - 在现有视频上绘图时,会出现闪烁(即使使用双缓冲和所有这些好东西),而且似乎没有办法在每帧回调期间获取视频中的帧索引(仅自上一帧以来经过的时间)。
I'm looking for a Python framework that will enable me to play video as well as draw on that video (for labeling purposes).
I've tried Pyglet, but this doesn't seem to work particularly well - when drawing on an existing video, there is flicker (even with double buffering and all of that good stuff), and there doesn't seem to be a way to get the frame index in the video during the per-frame callback (only elapsed time since the last frame).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试使用 OpenCV 的 Python 包装器,例如 ctypes-opencv。 C API 参考位于此处,并且包装器非常接近(请参阅文档字符串任何变化)。
我用它在视频上绘图,没有任何闪烁,所以你应该没有问题。
您需要的调用的粗略轮廓:
Try a Python wrapper for OpenCV such as ctypes-opencv. The C API reference is here, and the wrapper is very close (see docstrings for any changes).
I have used it to draw on video without any flicker, so you should have no problems with that.
A rough outline of calls you need:
Qt (PyQt) 有 Phonon,这可能会有所帮助。 PyQt 可作为 GPL 或付费软件使用。 (Qt 也有 LGPL,但 PyQt 包装器没有)
Qt (PyQt) has Phonon, which might help out. PyQt is available as GPL or payware. (Qt has LGPL too, but the PyQt wrappers don't)
尝试GStreamer 的 Python 绑定。
Try the Python bindings for GStreamer.