video

Video I/O module.

Classes

VideoReader

Video reader object.

VideoWriter

Video writer object.

class VideoReader(path, input_dict=None, output_dict=None)[source]

Bases: FFmpegReader

Video reader object.

Parameters:
  • path (Union[str, Path]) – The path to the video file.

  • input_dict (Optional[Dict[str, str]]) – Input options.

  • output_dict (Optional[Dict[str, str]]) – Output options.

class VideoWriter(path, input_dict=None, output_dict=None, overwrite=False)[source]

Bases: FFmpegWriter

Video writer object.

Parameters:
  • path (Union[str, Path]) – The path to the video file.

  • input_dict (Optional[Dict[str, str]]) – Input options.

  • output_dict (Optional[Dict[str, str]]) – Output options.

  • overwrite (bool) – Whether to overwrite existing files.

write(image)[source]

Appends an image to the existing video.

Parameters:

image (ndarray) – [H, W, 3] ndarray.

Returns: