Repository navigation
fix(rune-media): accept AVFoundation YCbCrMatrix#5 and #6 attachments as BT.601 on macOS - #1517
Merged
Merged
Conversation
… as BT.601 on macOS
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.
Fixes #1111
Root cause
PixelBuffer::info(crates/rune-media/src/native_surface/macos.rs) only matchedkCVImageBufferYCbCrMatrix_ITU_R_601_4andkCVImageBufferYCbCrMatrix_ITU_R_709_2onkCVImageBufferYCbCrMatrixKey.matrix_coefficients = 5(BT.470BG / BT.601-7 625, emitted by ffmpeg/libx264), so AVFoundation attaches the raw code-point string"YCbCrMatrix#5", causing playback to fail withunsupported YCbCr matrix; use BT.601 or BT.709.Changes
"YCbCrMatrix#5"(BT.470BG) and"YCbCrMatrix#6"(SMPTE 170M) incrates/rune-media/src/native_surface/macos.rstoMatrix::Bt601, per ITU-T H.264 Table E-5 and ITU-T H.273 Table 4 (both defineKr = 0.299, Kb = 0.114).None,kCVImageBufferYCbCrMatrix_ITU_R_601_4, andkCVImageBufferYCbCrMatrix_ITU_R_709_2mappings unchanged, and continue rejecting BT.2020, SMPTE 240M, FCC, and unknown matrices.ycbcr_matrix_5_and_6_map_to_bt601_and_other_codes_are_rejectedincrates/rune-media/src/native_surface/macos_tests.rs.changelog/unreleased/2026-11-23-macos-ycbcr-matrix-5.md.Verification
cargo test -p rune-media --lib native_surface::macos(failed before fix on"YCbCrMatrix#5", passed after fix),cargo check -p rune-media --tests,cargo check -p rune -p rune-kit --tests.cargo test -p rune-media(80 unit tests + 4 doctests passed).scripts/file-size.sh(0 errors).