1import cv2
2vidcap = cv2.VideoCapture('big_buck_bunny_720p_5mb.mp4')
3success,image = vidcap.read()
4count = 0
5while success:
6 cv2.imwrite("frame%d.jpg" % count, image) # save frame as JPEG file
7 success,image = vidcap.read()
8 print('Read a new frame: ', success)
9 count += 1
10