reparo.utils

reparo.utils.read_video(video_path, max_frames=None)[source]

Read frames from video input file

Parameters
  • video_path (str) – path to input video file

  • max_frames (int, optional) – maximum number of frames to read

Returns

video frames int: frames per second of the input video tuple<int, int>: video spatial dimensions

Return type

list<numpy.ndarray[H, W, 3]>

reparo.utils.write_video(frames, outfile, fps, frame)[source]

Write frames to video output file

Parameters
  • frames (list<numpy.ndarray[H, W, 3]>) – video frames

  • outfile (string) – path to output file

  • fps (int) – frames per second to write

  • frame (tuple<int, int>) – video spatial dimensions