import cv2 # 将视频文件按照每秒一张图进行抓取图片 file = '123.mp4' # path = file[:file.index('.')] vc = cv2.VideoCapture(file) # 读入视频文件 f = 1 i = 1 if vc.isOpened(): # 判断是否正常打开 rval, frame = vc.read() else: rval = False timeF = 25 # 视频帧计数间隔频率 while rval: # 循环读取视频帧 rval, frame =…