import cv2 vc = cv2.VideoCapture(r'C:\Users\ad\Desktop\Python\Framing\sheep_video\15_57_59.mp4') c = 1 timeF = 15 if vc.isOpened(): rval, frame = vc.read() else: rval = False while rval: rval, frame = vc.read() if (c % timeF == 0): cv2.imwrite(r'C:\Users\ad\Desktop\Python\Framing\sheep_jpg15_57_59\jpg' + str(c) + '.jpg', frame) c = c + 1 cv2.waitKey(1) vc.release()
将视频分割为图片
最新推荐文章于 2024-07-17 11:06:53 发布