Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Assuming that you want to save files from a video recording, you can do this :

import cv2

vid = cv2.VideoCapture("video.mp4")

d = 0 ret, frame = vid.read() while ret: ret, frame = vid.read() filename = "images/file_%d.jpg"%d cv2.imwrite(filename, frame) d+=1

Assuming that you want to save files from a video recording, you can do this :

import cv2

cv2 vid = cv2.VideoCapture("video.mp4")

vid = cv2.VideoCapture("video.mp4")

d = 0 ret, frame = vid.read() while ret: ret, frame = vid.read() filename = "images/file_%d.jpg"%d cv2.imwrite(filename, frame) d+=1

d+=1

Assuming that you want to save files from a video recording, you can do this :

import cv2

vid = cv2.VideoCapture("video.mp4")
 d = 0
ret, frame = vid.read()
 while ret:
    ret, frame = vid.read()
    filename = "images/file_%d.jpg"%d
    cv2.imwrite(filename, frame)
    d+=1