pub struct VideoFrame { /* private fields */ }Expand description
One exported video frame: tightly packed 8-bit pixels plus metadata.
The byte buffer is owned and has no row padding — as_bytes().len() equals
width * height * layout.bytes_per_pixel() and the row stride equals
width * layout.bytes_per_pixel(). This is the shape ML/CV consumers expect
(feed it straight into an ndarray view, a tensor, or an image encoder).
Implementations§
Source§impl VideoFrame
impl VideoFrame
Sourcepub fn layout(&self) -> PixelLayout
pub fn layout(&self) -> PixelLayout
The packed pixel layout of as_bytes.
Sourcepub fn pts_us(&self) -> Option<i64>
pub fn pts_us(&self) -> Option<i64>
Post-filter presentation time in microseconds, normalized to the start
of the extraction window (the stream start when no start_time_us was
set). Vsync passthrough preserves the source timing one-to-one; None
when the frame carried no usable timestamp.
Sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
The packed pixel bytes. Length is width * height * bytes_per_pixel;
rows are tight (row_bytes() each) and top-down.