Commit df8398a2 authored by Peiris M.D.P.'s avatar Peiris M.D.P.

Breaking the video into frames using OpenCV

parent 95b63b05
import cv2
# Opens the video file
cap = cv2.VideoCapture('F:/Videos/CUTE GSD PUPPY SLEEPING.mp4')
i = 0
while(cap.isOpened()):
ret, frame = cap.read()
if ret == False:
break
cv2.imwrite('kang'+str(i)+'.jpg',frame)
i += 1
cap.release()
cv2.destroyAllWindows()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment