From 22936bbc89f4c7fecab5671df37031d779877af8 Mon Sep 17 00:00:00 2001 From: Oscar <25+sassycrown@noreply.git.unom.io> Date: Wed, 29 Jul 2026 00:15:10 +0200 Subject: [PATCH] fix(vaapi): use FFmpeg bt2020nc matrix name FFmpeg rejects bt2020 as an out_color_matrix value. Use its canonical bt2020nc name for non-constant-luminance BT.2020, matching the existing AVCOL_SPC_BT2020_NCL encoder VUI. Co-Authored-By: OpenAI Codex --- crates/pf-encode/src/enc/linux/vaapi.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/pf-encode/src/enc/linux/vaapi.rs b/crates/pf-encode/src/enc/linux/vaapi.rs index 6b6ee8a4..d11086a6 100644 --- a/crates/pf-encode/src/enc/linux/vaapi.rs +++ b/crates/pf-encode/src/enc/linux/vaapi.rs @@ -157,7 +157,7 @@ struct Vui { } /// 10-bit HDR: BT.2020 primaries + SMPTE-2084 (PQ) transfer, limited range — matches the P010 the -/// CSC produces (swscale BT.2020 on the CPU path; `scale_vaapi` pinned to bt2020 on the zero-copy +/// CSC produces (swscale BT.2020 on the CPU path; `scale_vaapi` pinned to bt2020nc on the zero-copy /// path); the client decoder auto-detects PQ from the VUI. SDR: we hand the encoder BT.709 /// *limited* NV12 (swscale CSC on the CPU path; `scale_vaapi` pinned to /// `out_color_matrix=bt709:out_range=limited` on the zero-copy path, with the full-range RGB input @@ -204,7 +204,7 @@ fn async_depth(raw: Option<&str>) -> u32 { /// matrix untouched.) fn scale_vaapi_args(ten_bit: bool) -> &'static CStr { if ten_bit { - c"format=p010:out_color_matrix=bt2020:out_range=limited" + c"format=p010:out_color_matrix=bt2020nc:out_range=limited" } else { c"format=nv12:out_color_matrix=bt709:out_range=limited" } @@ -1565,7 +1565,7 @@ mod tests { let args = scale_vaapi_args(true).to_str().unwrap(); for needle in [ "format=p010", - "out_color_matrix=bt2020", + "out_color_matrix=bt2020nc", "out_range=limited", ] { assert!(