在读取视频流的同时保存视频流

保存一份视频流:

if saveFlag == '1':
    time = datetime.utcnow().replace(tzinfo=timezone.utc).astimezone(SHA_TZ)
    time_iso = time.isoformat(sep='T', timespec='seconds')
    out_path = 'save/' + scenarioStr + '_' + str(time_iso) + '.mp4'
    fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v')
    fps = 25
    frame_size = (int(capture.get(3)), int(capture.get(4)))
    video_writer = cv2.VideoWriter(out_path, fourcc, fps, frame_size)

你可能感兴趣的:(paddle,paddle)