not_working.py
1 | import sys |
---|---|
2 | import os |
3 | import cv2 |
4 | |
5 | def main(videofile): |
6 | print "Playing %s", videofile |
7 | assert os.path.exists(videofile)
|
8 | |
9 | capture = cv2.VideoCapture(videofile) |
10 | (status, frame) = capture.read() |
11 | |
12 | while frame is not None: |
13 | cv2.imshow("Frame", frame)
|
14 | key = cv2.waitKey() |
15 | if key == 27: |
16 | break
|
17 | (status, frame) = capture.read() |
18 | |
19 | if __name__ == "__main__": |
20 | main(sys.argv[1])
|