Skip to content

Fix playback of HDR AV1 videos in native viewer#7978

Merged
emilk merged 5 commits intomainfrom
emilk/native-av1-hdr
Nov 2, 2024
Merged

Fix playback of HDR AV1 videos in native viewer#7978
emilk merged 5 commits intomainfrom
emilk/native-av1-hdr

Conversation

@emilk
Copy link
Member

@emilk emilk commented Nov 2, 2024

What

Review with ignoring whitespace changes

Before

Screenshot 2024-11-02 at 12 02 13

After

Screenshot 2024-11-02 at 12 00 59

VLC (for reference)

Screenshot 2024-11-02 at 16 43 10

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@emilk emilk added include in changelog feat-video anything video decoding, player, querying, data modelling of videos etc. 📺 re_viewer affects re_viewer itself labels Nov 2, 2024
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! I trust there's still a separate warning about Bt.2020 interpretation and friends?
After all the problem with typical HDR content is twofold:

  • bit depth - partially better addressed here
  • color space conversion

@Wumpf
Copy link
Member

Wumpf commented Nov 2, 2024

oh interesting, the video in the issue is unplayable by Firefox. It has 10bit Bt.709 YUV 4:2:0
So indeed really the only thing we don't support here is the 10bits. Fascinating, didn't know that's a thing!

image

@emilk
Copy link
Member Author

emilk commented Nov 2, 2024

Btw @Wumpf we are missing a check that the number of bytes in the frame matches the given dimensions and pixel format. A debug-assert and/or warning in re_renderer would be very helpful

@Wumpf
Copy link
Member

Wumpf commented Nov 2, 2024

👍 good find, we should definitely add that

@emilk
Copy link
Member Author

emilk commented Nov 2, 2024

Actually, we do have a check here that triggers as it should:

// TODO(andreas): Nv12 needs height divisible by 2?
if data.len() != expected_num_bytes {
return Err(ImageDataToTextureError::InvalidDataLength {
label: label.clone(),
expected: expected_num_bytes,
actual: data.len(),
});
}

My bad!

@emilk
Copy link
Member Author

emilk commented Nov 2, 2024

Why does rerun_js fail?? O.o

Trying if rebasing on an earlier commit works…

@emilk emilk force-pushed the emilk/native-av1-hdr branch from 366936c to 808f7bd Compare November 2, 2024 16:17
@emilk emilk merged commit 04435c4 into main Nov 2, 2024
@emilk emilk deleted the emilk/native-av1-hdr branch November 2, 2024 16:34
@emilk emilk added the 🪳 bug Something isn't working label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪳 bug Something isn't working feat-video anything video decoding, player, querying, data modelling of videos etc. include in changelog 📺 re_viewer affects re_viewer itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Video opened through rerun looks distorted and has wrong colors

2 participants