Skip to content

fix(playback): drop default_base_moof from progressive remux (Tizen native player) - #217

Merged
JonahMMay merged 1 commit into
mainfrom
fix/remux-progressive-moof
Sep 30, 2026
Merged

JonahMMay merged 1 commit into
mainfrom
fix/remux-progressive-moof

Conversation

@JonahMMay

@JonahMMay JonahMMay commented Sep 30, 2026 •

Copy link
Copy Markdown

Progressive fMP4 remuxes don't play on Samsung Tizen's native player (capi-media-player, used by the Prairie Tizen app). The player can't follow moof-relative tfhd offsets (default_base_moof): it plays the first fragment, then stalls with no audio and reports "Not supported audio codec but video can be played". Every Tizen remux failed this way, and failure recovery then fell through to an HDR encode that has no recipe.

Found with Iron Man (HEVC Dolby Vision Profile 8 + TrueHD 7.1 Atmos only), which has to be remuxed for its audio.

Change

  • Progressive remux -movflags changes from frag_keyframe+delay_moov+default_base_moof to frag_keyframe+delay_moov. delay_moov stays, for copied E-AC-3/Atmos.
  • New test TestBuildRemuxArgsOmitsDefaultBaseMoof.
  • New prairie-invariants.txt entry, so an upstream sync can't restore the flag unnoticed.

Why it's safe for other clients

The progressive remux is a single byte stream, not MSE/CMAF segments, so explicit base data offsets are correct for it. Browser <video> (the web player consumes server_remux_progressive through <video src>, not MSE), Media3's fragmented MP4 extractor, and AVFoundation all read explicit offsets. HLS segments are produced by ffmpeg's HLS muxer and are unaffected.

Verification

On a QN700B (Tizen 6.5), clips of the Iron Man source, each 45 s from 0:00, piped through ffmpeg exactly as buildRemuxArgsWithAudioV3 builds them:

Variant Result
Server recipe as-is (DV8 hev1, AAC 5.1, default_base_moof) Freezes at ~8 s, no sound
Same with DV stripped (hvc1) Freezes at ~8 s, no sound
With default_base_moof, E-AC-3 instead of AAC Freezes at ~9 s
With default_base_moof, 2 s fragments Fails
Server recipe with default_base_moof removed (DV8 hev1, AAC 5.1) Plays
Without default_base_moof, DV stripped Plays
empty_moov, without default_base_moof Plays

Go isn't installed on the machine this was made on, so the unit tests are left to CI. The invariant check passes on an LF-normalized checkout (24/24).

Related, not in this PR

The 2026-08-28 upstream sync (#174) also reverted #153 ("choose the remux container instead of always writing MP4"). HandleStream passes a literal "mp4" again, and movflags are no longer MP4-only. Iron Man doesn't need that fix: its TrueHD must be re-encoded, and Matroska with AAC didn't play on the TV. It is still a regression worth restoring separately, with an invariant.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Updated fragmented MP4 playback output to avoid a setting associated with reported playback issues on Samsung Tizen devices.
    • Progressive remux output no longer includes the default_base_moof flag.

Samsung Tizen's native player (capi-media-player, used by the Prairie
Tizen app) cannot follow moof-relative tfhd offsets. On a progressive
fMP4 remux written with default_base_moof it plays the first fragment,
then stalls with no audio ("Not supported audio codec but video can be
played"), so every Tizen remux failed and recovery fell through to an
HDR encode that has no recipe (Iron Man: HEVC DV8 + TrueHD 7.1).

The progressive remux is one byte stream, not MSE/CMAF segments, so
explicit base data offsets are correct for it and every progressive
demuxer (browser <video>, Media3, AVFoundation) reads them. Verified on a
QN700B (Tizen 6.5) with the server's exact recipe piped through ffmpeg:
fails with the flag, plays with it removed, with DV8 kept (hev1) and with
DV stripped (hvc1), AAC 5.1 and E-AC-3 alike.

Add an invariant so an upstream sync cannot restore the flag unnoticed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 96fc0986-5342-4073-b27d-42622969f8b7

📥 Commits

Reviewing files that changed from the base of the PR and between 6212fe5 and b4955c1.

📒 Files selected for processing (3)
  • internal/playback/remux.go
  • internal/playback/remux_dv_test.go
  • scripts/prairie-invariants.txt
 ______________________________________________________________
< Random thought: What if bugs are just undocumented features? >
 --------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JonahMMay
JonahMMay merged commit 71dd42f into main Sep 30, 2026
19 of 20 checks passed
@JonahMMay
JonahMMay deleted the fix/remux-progressive-moof branch September 30, 2026 19:54
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