The VideoProcessor provides a unified API for video pipelines to prepare inputs for VAE encoding and post-processing outputs once they’re decoded. The class inherits VaeImageProcessor so it includes transformations such as resizing, normalization, and conversion between PIL Image, PyTorch, and NumPy arrays.
( video height: Optional = None width: Optional = None )
Parameters
List[PIL.Image], List[List[PIL.Image]], torch.Tensor, np.array, List[torch.Tensor], List[np.array]) —
The input video. It can be one of the following:(num_frames, num_channels, height, width)).(num_frames, height, width, num_channels)).(num_frames, num_channels, height, width)).(num_frames, height, width, num_channels)).(batch_size, num_frames, height, width, num_channels).(batch_size, num_frames, num_channels, height, width).int, optional, defaults to None) —
The height in preprocessed frames of the video. If None, will use the get_default_height_width() to
get default height. int, optional, defaults to None) -- The width in preprocessed frames of the video. If None, will use get_default_height_width() to get
the default width. Preprocesses input video(s).
( video: Tensor output_type: str = 'np' )
Converts a video tensor to a list of frames for export.