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

Eyevinn / mp4ff / 18874849030
82%
master: 82%

Build:
Build:
LAST BUILD BRANCH: sphericalv1
DEFAULT BRANCH: master
Ran 28 Oct 2025 12:32PM UTC
Jobs 1
Files 174
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

28 Oct 2025 12:30PM UTC coverage: 81.601% (+0.1%) from 81.501%
18874849030

Pull #465

github

tobbee
feat: add streaming/incremental processing for fragmented MP4 files.

Add Copy method for StypBox and FtypBox.

Implements support for processing fragmented MP4 files incrementally without
loading entire files into memory. This is essential for handling large media
files, live streaming scenarios, and network streams where fragments arrive
over time.

Key components:

1. StreamFile API (stream.go)
   - DecodeStream/InitDecodeStream: Reads init segment (ftyp, moov) and stops
   - ProcessFragments: Iteratively processes fragments with callbacks
   - Sliding window memory management with configurable retention
   - Fragment lifecycle callbacks for processing and cleanup control

2. BoxSeekReader (boxseekreader.go)
   - Emulates seeking on non-seekable streams using buffered reading
   - Auto-growing buffer sized for current needs
   - Peek operations for looking ahead without consuming data

3. SampleAccessor interface
   - GetSample: Fetch individual samples (1-based indexing)
   - GetSampleRange: Fetch ranges of samples efficiently
   - GetSamples: Fetch all samples for a track

Buffer management:
- ReadFullBox returns a slice view of the buffer (no copy for performance)
- Callers must use data immediately before next operation
- ResetBuffer() explicitly clears buffer after parsing is complete
- Buffer clearing happens after box parsing, not during ReadFullBox
- For mdat seeks, ResetBuffer() called after seek to avoid buffer corruption

Testing:
- Comprehensive test suite using external black-box testing (mp4_test package)
- Tests cover streaming, callbacks, sliding windows, retention, sample access
- All tests use public API only per project guidelines
Pull Request #465: Stream process support with example for on-the-fly MP4 encryption and refragmentation

806 of 962 new or added lines in 7 files covered. (83.78%)

18015 of 22077 relevant lines covered (81.6%)

0.9 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
6
88.46
examples/stream-encrypt/encryptor.go
18
81.05
examples/stream-encrypt/refragment.go
27
76.52
examples/stream-encrypt/main.go
29
88.21
mp4/boxseekreader.go
76
82.88
mp4/stream.go
Jobs
ID Job ID Ran Files Coverage
1 18874849030.1 28 Oct 2025 12:32PM UTC 174
81.6
GitHub Action Run
Source Files on build 18874849030
  • Tree
  • List 174
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #465
  • PR Base - master (#18166478260)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc