Answers for "how to extract frames from videos in python"

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 "how to extract frames from videos in python"

Python Answers by Framework

Browse Popular Code Answers by Language