VideoStream#
- class torchcodec.encoders.VideoStream(encoder_tensor: Tensor, stream_index: int)[source]#
A video stream within an
Encoder.Returned by
Encoder.add_video(). Useadd_frames()to feed video frames into this stream.Examples using
VideoStream:- add_frames(frames: Tensor) None[source]#
Add video frames to this stream.
- Parameters:
frames (
torch.Tensor) – The frames to encode. This must be a 4D tensor of shape(N, C, H, W)where N is the number of frames, C is 3 channels (RGB), H is height, and W is width. Values must be uint8 in the range[0, 255]. The device of the tensor must match thedevicepassed toEncoder.add_video().