FrameBatch¶
- class torchcodec.FrameBatch(data: Tensor, pts_seconds: Tensor, duration_seconds: Tensor)[source]¶
Multiple video frames with associated metadata.
The
data
tensor is typically 4D for sequences of frames (NHWC or NCHW), or 5D for sequences of clips, as returned by the samplers. Whendata
is 4D (resp. 5D) thepts_seconds
andduration_seconds
tensors are 1D (resp. 2D).Note
The
pts_seconds
andduration_seconds
Tensors are always returned on CPU, even ifdata
is on GPU.Examples using
FrameBatch
:Decoding a video with VideoDecoder
Decoding a video with VideoDecoderHow to sample video clips