xxxxxxxxxx
cap = cv2.VideoCapture("horse.mp4")
img_num = 1
while True:
ret, frame = cap.read()
if ret == False:
break
# Save frames using cv2.imwrite
cv2.imwrite("image_{}.jpg".format(img_num), frame) # Save image localy
img_num+=1
xxxxxxxxxx
Parameters
ext File extension that defines the output format. Must include a leading period.
img Image to be written.
buf Output buffer resized to fit the compressed image.
params Format-specific parameters. See cv::imwrite and cv::ImwriteFlags.