Skip to main content

detect_dims

Function detect_dims 

Source
pub fn detect_dims(codec: &str, samples: &[Vec<u8>]) -> Option<(u32, u32)>
Expand description

Public entry point — dispatch by codec and return Some((width, height)) if the sequence header in samples[0] is parseable, None otherwise.

Callers should treat None as “keep the existing width/height” — it’s load-bearing for MPEG-TS where StreamInfo would otherwise carry 0×0, but a parse failure on MP4/MKV (which already have width/height in the sample-entry / track-header) is a no-op.