framecut.py 317 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 from cv2 import cv2 for i in range(len('box.mp4')): cam = cv2.VideoCapture('box.mp4') currentFrame = 0 while(True): ret, frame = cam.read() if ret: cv2.imwrite(str(currentFrame) + '.jpg', frame) currentFrame += 1 else: break cam.release()