forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 8dbd683068d7f87f21dcc4ed1dfdca786d82c52bFiltered to crates/ec-mp4/tests/mp4.rsClear filter

2026-08-21

2026-08-20

feat(mux): declare an audio encoder's priming so no-elst/no-CodecDelay means zero delayAhmet Kaan Gümüş · f40e85c
feat(mux): declare an audio encoder's priming so no-elst/no-CodecDelay means zero delay

Root cause: mp4's elst and Matroska's CodecDelay only ever came from a
reordered video track's ctts offset, so an AAC track's encoder priming (one
1024-sample frame, always) was never written. A downstream reader had no way
to distinguish "this file truly has zero delay" from "this file's muxer never
said" and had to guess a fallback -- guessing wrong either trims real audio
from a genuinely delay-free file or leaves an encoder's priming samples in.

ec-mp4: Mp4Muxer::set_audio_delay(stream, priming_samples) folds into the
same elst media_time/segment_duration the video-reorder path already writes
(a shift, never a trim); the demuxer already applied elst generically, so no
demux change was needed there -- verified with a mux+demux round trip.

ec-matroska: the muxer already wrote CodecDelay (set_track_delay), but the
demuxer never read it back. CodecDelay is a decode-but-don't-play priming,
the same contract as StreamInfo::initial_padding (which mp3/Opus already use)
and not a timeline shift, so it is converted ns -> samples and reported there.

ec-aac: AacEncoder::encoder_delay() -> usize accessor (1024, the fixed cost
of the first MDCT window's overlap-add having nothing to overlap yet) for a
muxer caller to pass into the above.

Tests: ec-mp4::aac_priming_round_trips_through_an_elst,
ec-matroska::aac_priming_round_trips_through_codec_delay.

2026-08-14

test(fixtures): 24-bit ALAC, Matroska-carried audio and cover artAhmet Kaan Gümüş · abd41b6
test(fixtures): 24-bit ALAC, Matroska-carried audio and cover art

24-bit ALAC is the only path where a sample's low bytes ride
uncompressed beside the residuals; Matroska-carried aac/flac/opus and a
video-plus-sound mkv are what the probe delegates; the two cover-art
files are the claim that a still picture is never listed as a video
track.

The mp4 tests drop attached pictures from their ffprobe oracle for the
same reason: this crate does not list one, deliberately, and does not
write one either.
test(mp4): fixtures, real library, remux round trip and a fuzz loopAhmet Kaan Gümüş · 1bc9080
test(mp4): fixtures, real library, remux round trip and a fuzz loop

34 mp4/mov/m4a fixtures field-compare against ffprobe and remux into
files ffmpeg decodes with the same fields; the 23.976 ones assert the
exact 24000/1001. The extension test writes av01, hvc1, vp09, colr with
mdcv/clli, udta/name and a tx3g track from cues, and reads each back
through ffprobe. Ten thousand byte mutations of a real file open, demux
and seek without a panic, and the ignored real-library test walks every
mp4-family file in the manifest to EOF against ffprobe -count_packets.