Skip to content

fix(export): tag browser exports as limited range so Safari's whites stay white - #277

Merged
dazzatronus merged 1 commit into
mainfrom
derk/export-limited-range
Oct 30, 2026
Merged

dazzatronus merged 1 commit into
mainfrom
derk/export-limited-range

Conversation

@dazzatronus

@dazzatronus dazzatronus commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Every browser export from Safari plays with grey whites. Safari's VideoEncoder writes limited-range H.264: white is stored as 235, and the SPS carries no range flag. But it reports decoderConfig.colorSpace.fullRange: true. mediabunny writes that into the MP4's colr box, so players read 235 as light grey rather than white. Chrome reports false, so its exports are unaffected.

The exporter now sets fullRange to false in onEncodedPacket, which mediabunny calls before it muxes the packet's metadata. Chrome, Safari and Firefox all encode canvas frames as limited range. mediabunny 1.64.0, the latest, behaves the same, so updating it wouldn't help.

Verify: npm run verify:ci. Then, in Safari, export an edit with a white background: ffprobe -show_entries stream=color_range reports tv (it was pc), and the white plays as white in QuickTime.

Risk: if a browser ever encoded full-range output, its exports would be tagged limited and show crushed blacks and whites. Reading the flag from the SPS would remove that assumption.

Independent of #278: the two merge cleanly in either order, and pass together.

@dazzatronus
dazzatronus merged commit c6150eb into main Oct 30, 2026
1 check passed
@dazzatronus
dazzatronus deleted the derk/export-limited-range branch October 30, 2026 22:29
github-actions Bot pushed a commit that referenced this pull request Oct 30, 2026
## [2.30.1](v2.30.0...v2.30.1) (2026-10-30)

### Bug Fixes

* draw clip filters in the preview as the render applies them ([#265](#265)) ([ac02f9b](ac02f9b))
* draw html5 frames on a software canvas so Firefox keeps their gradients ([#280](#280)) ([d508db8](d508db8))
* **export:** draw export frames into one stencil target so Firefox keeps masked content ([#278](#278)) ([f431c6b](f431c6b))
* **export:** tag browser exports as limited range so Safari's whites stay white ([#277](#277)) ([c6150eb](c6150eb))
* keep a frame's embedded images when Safari draws an html5 clip ([#279](#279)) ([5154007](5154007))
* keep baking html5 clips while their tab is in the background ([#281](#281)) ([e1fa158](e1fa158))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.30.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant