Repository navigation
Conversation
meh7an
force-pushed
the
fix/hdr-video-sending
branch
from
October 12, 2026 08:03
cedb224 to
6c3172d
Compare
meh7an
force-pushed
the
fix/hdr-video-sending
branch
from
October 22, 2026 13:33
6c3172d to
7044f5f
Compare
Member
|
It inherits #31406’s alpha loss and can permanently remove transparency from generated stickers. |
Contributor
Author
Thanks, fixed in #31406's commit, so #31407 and #31408 get it too. HDR frames with an alpha plane are now tone mapped through YUVA420P10 instead of P010, and the alpha is copied back into the tone mapped image, so they keep their transparency like SDR frames do. Checked with an HDR-tagged VP9 webm with alpha: the send box preview and playback now show it with transparency, the same as the same file without the HDR tags. |
meh7an
force-pushed
the
fix/hdr-video-sending
branch
from
October 22, 2026 21:05
7044f5f to
f803cc4
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #31406, which adds the tone mapping this uses; only the last commit is new here.
When an HDR video is sent, the send box preview and the uploaded thumbnail (the clip reader), the video timeline in the photo editor and the re-encode used for a reduced quality or trimmed video all convert frames with plain swscale. The preview and timeline are washed out, and the re-encoded file is written as 8-bit SDR samples while it keeps the PQ or HLG tags of the source, so it looks broken for everyone who receives it.
These paths now go through one helper,
Streaming::ConvertFrameToARGB32(), which tone maps HDR frames the same way playback does and runs swscale for the rest. The re-encode tone maps HDR frames to SDR before encoding and tags the result with what it is: the BT.709 transfer, the SMPTE 170M matrix because swscale converts RGB to YUV with BT.601 coefficients, and BT.709 primaries, or the source primaries when they are not BT.2020, because only BT.2020 is converted.Testing
Tested on macOS 27.0, in a Debug build, with an 8-bit HLG video recorded on an iPhone: