mux/mp4: MP4 demuxer — mp4:// as a source
Read side of mp4://: parse moov/trak/stbl (stsd codecs+hvcC/avcC/channel info, stsz/stco/co64+stsc → per-sample offsets, stts+ctts → decode/ composition timing, stss → sync), rebuild a DiscTitle, and emit samples as PesFrames in global decode order. Video NALs are length-prefixed in MP4 — the exact framing the MKV muxer wants — so no reframing. Wired into input() so mp4:// flows to every sink (mkv://, audio://, json://, …). In-memory write→read round-trip test proves symmetry (streams, hvcC, sample sizes survive). Progressive MP4 only; fragmented (moof) is future.
This commit is contained in:
@@ -27,7 +27,9 @@ use std::io::{self, Seek, SeekFrom, Write};
|
||||
|
||||
mod audio;
|
||||
mod boxes;
|
||||
mod read;
|
||||
use boxes::{bx, fullbox};
|
||||
pub use read::Mp4Reader;
|
||||
|
||||
/// Nanoseconds per second — PTS is carried in ns, media timescales are Hz.
|
||||
const NS: i64 = 1_000_000_000;
|
||||
|
||||
Reference in New Issue
Block a user