first commit of get frames
This commit is contained in:
parent
e7484fc01b
commit
2b8cd5bf55
|
|
@ -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)
|
||||
Loading…
Reference in New Issue