• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Eyevinn / mp4ff / 44097516102
85%

Build:
DEFAULT BRANCH: master
Ran 17 Nov 2026 01:55PM UTC
Jobs 1
Files 240
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Nov 2026 01:54PM UTC coverage: 84.758% (+0.1%) from 84.662%
44097516102

push

github

tobbee
fix(mp4ff-crop): crop all sample tables, durations and edit lists

After #722, the sample-to-chunk table of a cropped file is valid, but
other parts of moov still described the uncropped media:

- sbgp kept its sample counts, so ffmpeg AAC files, which have a roll
  group for all samples, mapped more samples than the track has. subs
  and cslg were not cropped either.
- mdhd kept the full media duration.
- tkhd of every track was set to the movie duration, and every edit was
  shortened by the same amount, ignoring where the edit starts in the
  media. With AAC priming (mediaTime 1024), the edit ran up to 1024
  ticks past the last sample.
- The other tracks were cut at the same media time as the video or
  audio track that decides the end, ignoring their edit lists. With
  audio delayed 0.5s by an empty edit, a 2s crop kept 87 audio samples,
  where the movie presents 66.
- A crop that kept the last sample of a track failed with "no matching
  sample found", for example -d 9999 on a 10.02s AAC file, and a
  duration after the last sync sample failed too.

The end of the movie is now the end of the presentation of the track
that decides it, mapped through its edit list, and the other tracks keep
the samples up to the media time that their edit lists present there.
Each edit list is cropped to the composition end of the kept samples and
to the movie end, tkhd is the sum of its edits, and mdhd the sum of the
sample durations. The requested duration is also presentation time: the
crop ends just before the first sync sample after sample 1 whose
composition time maps to the duration or later, and keeps all samples
if there is none. For audio without stss, the crop now ends at the start
of the first frame at or after the duration, one frame earlier than
before. The durations round up
to whole movie ticks, so that a file cropped after its end keeps its
durations.

cropStsc merges an entry that it shrinks into the entry before when they
then match, so that th... (continued)

209 of 226 new or added lines in 1 file covered. (92.48%)

7 existing lines in 2 files now uncovered.

27782 of 32778 relevant lines covered (84.76%)

0.85 hits per line

Uncovered Changes

Lines Coverage ∆ File
17
87.85
5.81% cmd/mp4ff-crop/main.go

Coverage Regressions

Lines Coverage ∆ File
6
94.62
0.15% mp4/stsc.go
1
87.85
5.81% cmd/mp4ff-crop/main.go
Jobs
ID Job ID Ran Files Coverage
1 44097516102.1 17 Nov 2026 01:55PM UTC 240
84.76
GitHub Action Run
Source Files on build 44097516102
  • Tree
  • List 240
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 5446070d on github
  • Prev Build on master (#44097413385)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc