Advertisement
dan-masek

Untitled

Apr 20th, 2018
804
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. import cv2
  2. import numpy as np
  3. import os
  4. os.environ['SDL_VIDEO_CENTERED'] = '1'
  5.  
  6. file_name = "f:\\MOV_20170813_0318580.mp4"
  7. window_name = "window"
  8. interframe_wait_ms = 30
  9.  
  10. cap = cv2.VideoCapture(file_name)
  11.  
  12. cv2.namedWindow(window_name, cv2.WND_PROP_FULLSCREEN)
  13. cv2.setWindowProperty(window_name, cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN)
  14.  
  15. while (cap.isOpened()):
  16.     ret, frame = cap.read()
  17.     if not ret:
  18.         break
  19.     cv2.imshow(window_name, frame)
  20.     if cv2.waitKey(interframe_wait_ms) & 0x7F == ord('q'):
  21.         break
  22.  
  23. cap.release()
  24. cv2.destroyAllWindows()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement