Skip to content

Instantly share code, notes, and snippets.

@aaronpolhamus
Created June 14, 2016 22:07
Show Gist options
  • Save aaronpolhamus/a5219b1c36e41332b4cc328a5ff016e2 to your computer and use it in GitHub Desktop.
Save aaronpolhamus/a5219b1c36e41332b4cc328a5ff016e2 to your computer and use it in GitHub Desktop.
import numpy as np
import cv2
file_name = '/home/ubuntu/motocross.mp4'
cap = cv2.VideoCapture(file_name)
counter = 0
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
counter += 1
cv2.imshow('frame', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment