Skip to content

Instantly share code, notes, and snippets.

@CreedsCode
Last active December 23, 2020 10:20
Show Gist options
  • Save CreedsCode/acf5cc36cd7589553931c1ac351fb65c to your computer and use it in GitHub Desktop.
Save CreedsCode/acf5cc36cd7589553931c1ac351fb65c to your computer and use it in GitHub Desktop.
Splice the images out of a video
import cv2
vidcap = cv2.VideoCapture('video.mp4')
success, image = vidcap.read()
count = 1
while success:
cv2.imwrite("output/image_%d.jpg" % count, image)
success, image = vidcap.read()
print('Saved ', count)
count += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment