Files
MP42Foundation/MP42
Scott GarrettandClaude Code 0cf79eca1c Rebuild Matroska chapters on remux and recompute Info Duration
MP42MkvRemuxer gains replacementChapters: when set, the Chapters element
is rebuilt from the model track instead of copied verbatim (chapterCount
0 removes the element and its SeekHead entry). Chapter timecodes are
written as absolute nanoseconds — libmatroska/mkvtoolnix/ffmpeg all
treat them as ns regardless of TimecodeScale, confirmed by hex-dumping
a mkvmerge-written file and reading it back with mkvinfo and ffprobe.
ChapterAtom is 0xB6 (0xB0 is PixelWidth), and mandatory EditionUID/
ChapterUID are derived deterministically from the content because
ffmpeg silently skips atoms without a ChapterUID. Starts are sorted
ascending with ties clamped to previous+1ms (mkvmerge rejects
non-ascending), empty titles get the importer's "Chapter N" fallback,
and the last atom's end rides the track duration only when known.

An existing Info Duration is recomputed as the greatest written block
start+1ms: the Info payload is rewritten with a fixed 8-byte double
slot patched after the clusters stream past, converted to TimecodeScale
units. Added blocks measure start+1 like source blocks so a second
no-op remux stays byte-identical (including BlockDuration broke
idempotence). Files without a source Duration keep having none.

The importer's chapter /1e6 needed no change (Start is already ns); a
comment now records that so it doesn't get "fixed" to scale-based math.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-26 12:54:43 -05:00
..
2013-11-01 08:38:09 +01:00
2026-09-22 20:18:56 +02:00
2022-02-24 10:25:17 +01:00
2026-09-22 20:18:56 +02:00
2026-09-22 20:18:56 +02:00
2026-09-22 20:18:56 +02:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2024-08-05 12:22:55 +02:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2026-09-29 19:55:05 +02:00
2026-10-03 11:46:29 +02:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2024-07-03 14:13:58 +02:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2026-10-03 11:46:29 +02:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2024-06-25 12:10:48 +02:00
2021-05-28 14:56:10 +02:00
2021-05-28 14:56:10 +02:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2022-01-02 09:31:49 +01:00
2026-09-29 19:55:05 +02:00
2017-09-29 22:10:09 +02:00
2017-11-27 09:22:08 +01:00
2024-11-29 12:31:30 +01:00
2013-11-01 10:20:09 +01:00
2013-11-01 10:20:09 +01:00