Skip to main content

demux_mp4_packets

Function demux_mp4_packets 

Source
pub fn demux_mp4_packets(
    bytes: &[u8],
    out: &mut [VideoPacket],
) -> Result<usize, CvError>
Expand description

Iterate the FIRST video track’s coded sample packets into the caller’s buffer. Writes up to out.len() packets and returns the number written.

Timestamps are converted to milliseconds via the track timescale. is_keyframe comes from each sample’s sync flag.

  • EmptyInput if bytes is empty.
  • InvalidParameter on parse failure, zero timescale, or no video track.

Never panics.