Created
December 4, 2022 13:37
-
-
Save abdulmoeez1225/d0f8f622b4a9502cde4ee5d09bc62ec7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # Python3 program to extract and save video frame | |
| # using OpenCV Python | |
| #import computer vision module | |
| import cv2 | |
| # define the video path | |
| file = 'IMG_4329.mov' | |
| # capture the video | |
| cap = cv2.VideoCapture(file) | |
| i = 0 # frame index to save frames | |
| # extract and save the video frames | |
| while cap.isOpened(): | |
| ret, frame = cap.read() | |
| ret, frame = cap.read() | |
| if ret: | |
| cv2.imwrite('test_frame_'+str(i)+'.png', frame) | |
| i+=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment