Skip to content

Instantly share code, notes, and snippets.

@NickShargan
Created March 28, 2018 17:40
Show Gist options
  • Save NickShargan/2198086a30b384d2d89758c65713b285 to your computer and use it in GitHub Desktop.
Save NickShargan/2198086a30b384d2d89758c65713b285 to your computer and use it in GitHub Desktop.
import numpy as np
import cv2
video_path = "./vid.mp4"
cap = cv2.VideoCapture(video_path)
if not cap.isOpened():
print("error opening video stream")
while (cap.isOpened()):
ret, frame = cap.read()
if ret:
cv2.imshow('frame', frame)
if cv2.waitKey(30) & 0xFF == ord('q'):
break
else:
break
cv2.destroyAllWindows()
cap.release()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment