spdl.io.convert_frames¶
- convert_frames(frames: AudioFrames | VideoFrames | ImageFrames | list[AudioFrames] | list[VideoFrames] | list[ImageFrames], storage: CPUStorage | None = None, **kwargs) CPUBuffer [source]¶
Convert the decoded frames to buffer.
- Parameters:
frames – Frames objects.
storage (spdl.io.CPUStorage) – Storage object. See
spdl.io.cpu_storage()
.
- Returns:
- A Buffer object.
The shape of the buffer obejct is
AudioFrames
->[C, H]
or[N, C]
.VideoFrames
->[N, C, H, W]
or[N, H, W, C]
.ImageFrames
->[C, H, W]
.list[AudioFrames]
->[B, C, H]
or[B, N, C]
.list[VideoFrames]
->[B, N, C, H, W]
or[B, N, H, W, C]
.list[ImageFrames]
->[B, C, H, W]
.
where
B
: batchC
: channel (color channel or audio channel)N
: framesW
: widthH
: height