Skip to content

Put a DASH video and its audio in one file without re-encoding - #208

Merged
abrignoni merged 1 commit into
mainfrom
feat/exoplayer-av
Sep 26, 2026
Merged

abrignoni merged 1 commit into
mainfrom
feat/exoplayer-av

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Puts a DASH video and its audio from an app's ExoPlayer cache into one playable file, without re-encoding.

  • New gleapp/mp4mux.py rewrites the track boxes into one header and copies every sample unchanged. Fragmented MP4: fragments interleaved by decode time, audio track renumbered, sequence numbers and absolute base offsets rewritten. Progressive MP4: both files carried whole, chunk offsets shifted as co64.
  • The cache pass combines a video with the one cached audio stream its manifest lists, for joined DASH streams and whole-file streams alike, as exoplayer_av_*.mp4. With two or more audio streams the pairing would be a guess, so none is combined. A whole-file input cut short at a gap is not combined. The silent video stays in the case.
  • New fixtures in tests/fixtures/mux/ are ffmpeg test sources (commands in the test). Where ffmpeg is installed, a test compares each stream's per-frame MD5 with the inputs'.

On two Android images: 100 combined files, each matching its separate inputs frame for frame in video and audio, all decoded by GLEAPP.

🤖 Generated with Claude Code

DASH serves picture and sound as separate streams, so the ExoPlayer
cache holds a silent video and a separate audio track. The new
gleapp/mp4mux.py rewrites the track boxes into one header and copies
every sample unchanged, for fragmented MP4 (fragments interleaved by
decode time, track ids and sequence numbers renumbered, absolute base
offsets moved) and for progressive MP4 (both files carried whole, chunk
offsets shifted and written as co64).

The cache pass combines a video with the one cached audio stream its
manifest lists, joined DASH streams and whole-file streams alike, and
registers the result as exoplayer_av_*.mp4; with two or more audio
streams the pairing would be a guess, so none is combined. A whole-file
input cut short at a gap is not combined. The silent video stays in the
case as what was cached.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abrignoni
abrignoni enabled auto-merge September 26, 2026 21:39
@abrignoni
abrignoni merged commit fe80966 into main Sep 26, 2026
8 checks passed
@abrignoni
abrignoni deleted the feat/exoplayer-av branch September 26, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant