Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2
- import numpy as np
- import os
- os.environ['SDL_VIDEO_CENTERED'] = '1'
- file_name = "f:\\MOV_20170813_0318580.mp4"
- window_name = "window"
- interframe_wait_ms = 30
- cap = cv2.VideoCapture(file_name)
- cv2.namedWindow(window_name, cv2.WND_PROP_FULLSCREEN)
- cv2.setWindowProperty(window_name, cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN)
- while (cap.isOpened()):
- ret, frame = cap.read()
- if not ret:
- break
- cv2.imshow(window_name, frame)
- if cv2.waitKey(interframe_wait_ms) & 0x7F == ord('q'):
- break
- cap.release()
- cv2.destroyAllWindows()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement