Created
October 10, 2020 03:56
-
-
Save Fitzy1293/ea0c0e431298c4b82b57c7aa73bc672e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
import cv2 | |
import os | |
vidcap = cv2.VideoCapture('norm.mp4') | |
success, image = vidcap.read() | |
dir = os.getcwd() | |
count = 0 | |
while success: | |
fname = os.path.join(dir, 'frames', f'{count}.jpg') | |
print(fname) | |
cv2.imwrite(fname, image) | |
success,image = vidcap.read() | |
print('Read a new frame: ', success) | |
count += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment