Skip to main content

VIDEO_CLIP

Constant VIDEO_CLIP 

Source
pub const VIDEO_CLIP: &str = "type VideoClip { frames: List[VideoFrame]; }";
Expand description

An immutable-value sequence of validated decoded video frames.

The SDK requires a nonempty sequence, strictly increasing timestamps and consistent image dimensions, dtype and channel format. Tensor buffers retain shared ownership. A live stream additionally needs host backpressure and lifetime handling.

§Declaration

type VideoClip { frames: List[VideoFrame]; }

§Fields and methods

  • frames: A nonempty ordered list of decoded frames with matching layouts.

§Construct VideoClip

Inspect the typed payload and metadata.

let image = ImageFrame { pixels: tensor[u8]([255, 0, 0], [1, 1, 3])? };
let clip = VideoClip { frames: [VideoFrame { image: image, timestamp_ns: 0 }, VideoFrame { image: image, timestamp_ns: 16666667 }] };
print(clip.frames.len());