You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0e49ee5
Browse filesBrowse the repository at this point in the historyBrowse files
An MP4 or a WebM cut short loses the share of its pictures asked for (#243)
* An MP4 or a WebM cut short loses the share of its pictures asked for
--damage truncate cut only the padding of a film of 1 MB or more, because
both containers kept all of it behind the pictures. A film a damage will cut
now splits its padding around them: free boxes between moov and mdat in an
MP4, its chunk places moved with them and widened to co64 only when the media
data then passes 4 GiB, and a Void between the Tracks and the first cluster
in a WebM, its Cues moved with it. ffmpeg's faststart and mkvmerge write the
same layouts.
A WebM a damage will cut is coded twice, once for the lengths of its
clusters, as every MP4 is. So its map, and the manifest's cut, gives the
length of its pictures, which it left empty.
Films nothing cuts are byte for byte what they were.
The structural checker allows both layouts and still requires the tables to
land. Both formats leave the ratchet of formats that do not cut at the share.
The new guard holds every size and cut it sweeps to the share, and every
sample to the bytes of the same sample in the film nothing cuts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* The cut guards reach every case they plan and keep a witness behind the content
An MP4 no longer cuts in the padding behind its pictures, and it was the
case that showed the manifest's note for a cut there. The note's case moves
to the one format that still cuts there: a WebP of 4 KiB cut by 1%, whose
picture grows to fill the file and leaves more behind it than the cut takes.
The share sweep asked only the files its manifest listed, so a format that
lost one planned file passed on the others. A planned file the manifest
leaves out is now an error, with a canary.
A switch over the roles of a film's map names its padding.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
returncore.Defect(fmt.Errorf("mp4: the pictures came to %d B of media data and the file is %d B, which leaves no room for the free box every one of these carries",
153
+
content, p.Bytes))
154
+
}
147
155
148
-
o:=&out{w: w, buf: make([]byte, 0, 64<<10)}
149
-
content:=l.writeMovie(o, z)
156
+
// The map: the file type and the movie box, the free boxes in front of the
157
+
// media data when a damage will cut the film, then the media data box with
158
+
// the pictures, then the free boxes that make up the size. The first pass
159
+
// has every length, so all of it is marked before a byte goes out.
// The padding is what the first pass's lengths leave, not what the second
160
-
// pass wrote, so a second pass that came out different leaves the file a
161
-
// different size from the plan - which the engine refuses - rather than a
162
-
// movie box that describes samples it does not carry.
163
-
pad:=p.Bytes-l.front() -content
164
-
ifpad<minFree {
165
-
returncore.Defect(fmt.Errorf("mp4: the pictures came to %d B of media data and the file is %d B, which leaves no room for the free box every one of these carries",
0 commit comments