From 3ee4144a8123da467cc771acc1d449e98668a8e2 Mon Sep 17 00:00:00 2001 From: Jason Lu <151680919+Nottlespike@users.noreply.github.com> Date: Wed, 27 May 2026 08:31:58 -0700 Subject: [PATCH] fix(macos): drop max_ref_frames=1 for h264_videotoolbox and enable PARALLEL_ENCODING (#5200) --- src/video.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/video.cpp b/src/video.cpp index 00af66c3a..f2281ce84 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -1134,12 +1134,16 @@ namespace video { }, { // Common options + // Note: max_ref_frames is intentionally omitted for H.264 because + // VideoToolbox on Apple Silicon produces all-IDR output when + // ReferenceBufferCount=1 is set for H.264, causing massive bandwidth + // inflation (~3x) and frame drops. HEVC and AV1 are unaffected and + // retain max_ref_frames=1. See LizardByte/Sunshine#5013. { {"allow_sw"s, &config::video.vt.vt_allow_sw}, {"require_sw"s, &config::video.vt.vt_require_sw}, {"realtime"s, &config::video.vt.vt_realtime}, {"prio_speed"s, 1}, - {"max_ref_frames"s, 1}, }, {}, // SDR-specific options {}, // HDR-specific options @@ -1151,7 +1155,7 @@ namespace video { }, "h264_videotoolbox"s, }, - DEFAULT + PARALLEL_ENCODING }; #endif