📜  将 python 中的视频转换为单个帧 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:46.989000             🧑  作者: Mango

代码示例1
import cv2
vidcap = cv2.VideoCapture('big_buck_bunny_720p_5mb.mp4')
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