FrameBatch¶
- class torchcodec.FrameBatch(data: Tensor, pts_seconds: Tensor, duration_seconds: Tensor)[source]¶
Multiple video frames with associated metadata.
The
datatensor is typically 4D for sequences of frames (NHWC or NCHW), or 5D for sequences of clips, as returned by the samplers. Whendatais 4D (resp. 5D) thepts_secondsandduration_secondstensors are 1D (resp. 2D).Note
The
pts_secondsandduration_secondsTensors are always returned on CPU, even ifdatais on GPU.Examples using
FrameBatch:
Parallel video decoding: multi-processing and multi-threading
Parallel video decoding: multi-processing and multi-threading