display video on python without opencv?

天涯浪子 提交于 2021-01-28 05:42:28

问题


I am using openCv for making video processing. What I do is reading a video frame by frame, then applying some processing on each frame and then displaying the new modified frame. My code looks like that :

video_capture = cv2.VideoCapture('video.mp4')


while True:
# Capture frame-by-frame
  ret, frame = video_capture.read()

# Applying some processing to frame
                 .
                 .
                 .
# Displaying the new frame with processing
  img=cv2.imshow('title', frame)

  if cv2.waitKey(1) & 0xFF == ord('q'):
      break

This way I can display instantaneously the processed video. The problem is the display is lagging much due to the presence of the 'waitkey'. Is there another way for display images in real time to form a video, but with another module than cv2?

Thank you


回答1:


One option is Tkinter, you can find some information here. Along with Tkinter, it uses python-gstreamer and python-gobject. It is much more complicated to set up, however it allows for more customization options.



来源:https://stackoverflow.com/questions/44140354/display-video-on-python-without-opencv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!