Answers for "extract frames from video python sctipt"

2

extract frames from video python

import cv2
video_name = "name.mp4" # or any other extension like .avi etc
vidcap = cv2.VideoCapture(video_name)
success,image = vidcap.read()
count = 0
while success:
  cv2.imwrite("frame%d.jpg" % count, image)     # save frame as JPEG file      
  success,image = vidcap.read()
  print('Read a new frame: ', success)
  count += 1
Posted by: Guest on April-28-2021

Code answers related to "extract frames from video python sctipt"

Python Answers by Framework

Browse Popular Code Answers by Language