Python Video Framework

I am looking for a Python framework that will allow me to play videos as well as draw on this video (for labeling purposes).

I tried Pyglet, but it doesn’t work particularly well - when drawing an existing video there is flicker (even with double buffering and all this good stuff), and it seems to be a way to get the frame index in the video during the callback for each frame (just past time since the last frame).

+4
source share
3 answers

Try the Python shell for OpenCV, such as ctypes-opencv . The C API link is here , and the shell is very close (see Docstrings for any changes).

I used it to paint without any flicker, so you shouldn't have a problem with this.

A rough outline of the necessary calls:

  • Download the video using cvCreateFileCapture, download the cvFont font.
  • Take a frame with cvQueryFrame, increase the frame counter.
  • Draw a frame with cvPutText, cvEllipse, etc. etc.
  • Display to user using cvShowImage.
+2
source

Qt (PyQt) has a Phonon that can help. PyQt is available as GPL or payware. (Qt also has an LGPL, but PyQt wrappers do not)

+2
source

Source: https://habr.com/ru/post/1286315/


All Articles