pub struct Sample {
pub data: Vec<u8>,
pub pts_ticks: i64,
pub duration_ticks: u32,
}Expand description
One demuxed video sample with its container-level timing.
data is the codec-native bitstream for the sample — Annex-B for
AVC/HEVC (after AVCC→Annex-B conversion + Squad-14 parameter-set
tracking), raw OBU stream for AV1, IVF/raw frame for VP8/VP9,
self-contained frame for ProRes.
pts_ticks is in the container’s native timescale (mp4 mvhd
timescale, MKV TimecodeScale-derived, TS 90 kHz, AVI samples-since-
start). The pipeline today does NOT consume per-sample PTS for
decode (decoders pull frames at their own cadence) — it’s surfaced
for the muxer/QA bench to attribute durations.
duration_ticks defaults to 0 when the container does not record a
per-sample duration (TS PES, AVI movi walk). Callers should fall
back to 1 / frame_rate from the header in that case.
Fields§
§data: Vec<u8>§pts_ticks: i64§duration_ticks: u32