first commit of get frames

This commit is contained in:
Loic Delattre 2023-02-02 10:51:08 +01:00
parent e7484fc01b
commit 2b8cd5bf55
1 changed files with 18 additions and 0 deletions

18
get_frames.py Normal file
View File

@ -0,0 +1,18 @@
import cv2
# Opens the Video file
video = 'my_face.mov'
def get_frames(vid):
cap= cv2.VideoCapture(vid)
i=0
while(cap.isOpened()):
ret, frame = cap.read()
if ret == False:
break
cv2.imwrite('frames/frame'+str(i)+'.jpg',frame)
i+=1
cap.release()
cv2.destroyAllWindows()
return
get_frames(video)