Repository navigation
Read self-contained .m4s fragmented MP4 videos (#354) - #603
Merged
Merged
Conversation
An .m4s that starts with ftyp + moov and then holds styp / sidx / moof / mdat fragments (GPAC and some downloaders save them) is a fragmented MP4 FFmpeg reads directly: it becomes a read-only video source with every video and audio target, like USM and the raw H.264 / H.265 streams. A DASH media segment, whose top-level boxes reach a moof before any moov, only plays with its separate init segment. MediaInfo.ProbeAsync now refuses such an .m4s before ffprobe runs, with error.m4s_needs_init in all 17 languages, instead of FFmpeg's demuxer error. Settings schema 48 adds .m4s to the video donut of existing libraries. The README format count goes to 265, the registry's count (the FIT reader had not bumped it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KnifeLemon
pushed a commit
that referenced
this pull request
Oct 26, 2026
Keep both schema steps: v47 learns .fit and .fon, v48 learns .m4s (#603). Keep the error.fon_* and error.m4s_needs_init keys in every language file. README format count 265 -> 266 (the registry now has .fon too). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ApPC2ToT2xB1UGEZCUBD4q
7 of 12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #354
What it does
.m4sis a read-only video (FormatRegistry:m4s, video,Writable: false). A self-contained one,ftyp+moovat the start and thenstyp/sidx/moof/mdatfragments (the layout in the report, written by GPAC), is a fragmented MP4 that FFmpeg reads directly, so it goes to every video and audio target like USM or the raw H.264 / H.265 streams..m4sreach amoofbefore anymoov, the piece only plays with a separate init segment.DashSegmentchecks this at the start ofMediaInfo.ProbeAsync, so every FFmpeg path (convert, cut a clip, merge, frames) refuses it withConversionRefusedException("error.m4s_needs_init")before ffprobe runs, instead of showing FFmpeg's demuxer error. Files that aren't box structures, or are damaged, are still left to FFmpeg. Only.m4sfiles are checked..m4s; custom claims stay put. (feat(fonts): read bitmap .fon and convert each size to TTF, OTF, WOFF, WOFF2 and EOT #561 also uses 47 and will need renumbering when it lands.)error.m4s_needs_initin all 17 language files (Korean in 해요체).docs/ENGINES.mdnext to USM. The README count goes 263 → 265 in all 14 READMEs: the registry now has 265 entries. The FIT reader (Read Garmin FIT activities into the geospatial formats (#451) #530) added one without bumping the count.Tests
DashSegmentTests(no FFmpeg): init-segment detection on synthetic boxes (bare segment, ftyp+moov+fragments, moov at the end, non-BMFF and cut-short data), and only.m4snames are refused.M4sFormatTests(Core): registry entry, video profile, the 47 → 48 migration runs once.MediaTests: the route (m4s→mp4is one FFmpeg step, nothing writesm4s). With FFmpeg installed, a 2 s fragmented MP4 is generated (frag_keyframe+empty_moov+default_base_moof) and rewritten to the reporter's layout with astypbefore eachmoof. It converts to MP4 with video and audio. The same fragments withoutftyp+moovfail witherror.m4s_needs_init. No sample files are added.Ran locally with FFmpeg 9.0.2 fetched by
build/fetch-engines.ps1: Filee.Engines.Tests 1827 passed / 83 skipped / 0 failed, Filee.Core.Tests 627 passed, the App localization/settings tests 204 passed.dotnet format --verify-no-changesis clean.🤖 Generated with Claude Code