FrameBatch¶
- class torchcodec.FrameBatch(data: Tensor, pts_seconds: Tensor, duration_seconds: Tensor)[source]¶
包含关联元数据的多个视频帧。
data
张量通常是 4 维,用于帧序列(NHWC 或 NCHW),或 5 维,用于剪辑序列,如 samplers 所返回。当data
是 4 维(或 5 维)时,pts_seconds
和duration_seconds
张量是 1 维(或 2 维)。注意
即使
data
在 GPU 上,pts_seconds
和duration_seconds
张量也总是返回到 CPU 上。使用
FrameBatch
的示例