取前15幀,再挑一張你要的。
import cv2
vidcap = cv2.VideoCapture('Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film.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()
count += 1
if count>=15: break