From 4358853d6e961b5566078fd7bd97eeb51e02bd8c Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 9 Sep 2026 19:48:23 -0400 Subject: [PATCH 1/4] FFmepg 9 fixes --- cmake/compile_definitions/common.cmake | 11 +++----- cmake/dependencies/nv_codec_headers.cmake | 5 ++++ package-lock.cmake | 11 ++++++++ src/config.cpp | 8 ++++-- src/config.h | 14 +++++++++-- src/nvenc/nvenc_dynamic_factory.cpp | 8 ++++++ src/nvenc/nvenc_dynamic_factory_versions.h | 16 ++++++++++++ src/nvenc/nvenc_sdk.h | 2 +- src/nvenc/nvenc_version.h | 4 +++ src/video.cpp | 6 ++--- tests/unit/test_config.cpp | 29 ++++++++++++++++++++++ tests/unit/test_nvenc_dynamic_factory.cpp | 7 +++--- tests/unit/test_nvenc_version.cpp | 4 +-- tests/unit/test_video.cpp | 28 +++++++++++++++++++++ 14 files changed, 133 insertions(+), 20 deletions(-) diff --git a/cmake/compile_definitions/common.cmake b/cmake/compile_definitions/common.cmake index c662a00193b..01faa7105f9 100644 --- a/cmake/compile_definitions/common.cmake +++ b/cmake/compile_definitions/common.cmake @@ -110,11 +110,13 @@ if(WIN32) add_nvenc_sdk_implementation(nvenc_sdk_1100 1100 "${NV_CODEC_HEADERS_11_INCLUDE_DIR}") add_nvenc_sdk_implementation(nvenc_sdk_1200 1200 "${NV_CODEC_HEADERS_12_INCLUDE_DIR}") add_nvenc_sdk_implementation(nvenc_sdk_1300 1300 "${NV_CODEC_HEADERS_13_INCLUDE_DIR}") + add_nvenc_sdk_implementation(nvenc_sdk_1301 1301 "${NV_CODEC_HEADERS_13_1_INCLUDE_DIR}") list(APPEND NVENC_SOURCES $ $ $ + $ ) endif() @@ -209,13 +211,8 @@ include_directories( ${Boost_INCLUDE_DIRS} # has to be the last, or we get runtime error on macOS ffmpeg encoder ) -if(WIN32) - include_directories(BEFORE SYSTEM "${NV_CODEC_HEADERS_13_INCLUDE_DIR}") -else() - include_directories( - BEFORE SYSTEM - "${CMAKE_SOURCE_DIR}/third-party/build-deps/third-party/FFmpeg/nv-codec-headers/include" - ) +if(NOT APPLE) + include_directories(BEFORE SYSTEM "${NV_CODEC_HEADERS_13_1_INCLUDE_DIR}") endif() list(APPEND SUNSHINE_EXTERNAL_LIBRARIES diff --git a/cmake/dependencies/nv_codec_headers.cmake b/cmake/dependencies/nv_codec_headers.cmake index b7910557fc0..a80a1e84801 100644 --- a/cmake/dependencies/nv_codec_headers.cmake +++ b/cmake/dependencies/nv_codec_headers.cmake @@ -1,3 +1,8 @@ +if(NOT APPLE) + CPMGetPackage(nv_codec_headers_13_1) + set(NV_CODEC_HEADERS_13_1_INCLUDE_DIR "${nv_codec_headers_13_1_SOURCE_DIR}/include") +endif() + if(WIN32) CPMGetPackage(nv_codec_headers_13) CPMGetPackage(nv_codec_headers_11) diff --git a/package-lock.cmake b/package-lock.cmake index 2542d73dfbc..befdc328e41 100644 --- a/package-lock.cmake +++ b/package-lock.cmake @@ -65,3 +65,14 @@ CPMDeclarePackage(nv_codec_headers_13 GIT_TAG ${NV_CODEC_HEADERS_13_TAG} DOWNLOAD_ONLY YES ) + +# NVENC SDK 13.1 headers +# renovate: datasource=github-tags depName=FFmpeg/nv-codec-headers +# versioning=regex:^n(?13)\.(?1)\.(?\d+)\.(?\d+)$ +set(NV_CODEC_HEADERS_13_1_TAG n13.1.15.0) +CPMDeclarePackage(nv_codec_headers_13_1 + NAME nv_codec_headers_13_1 + GIT_REPOSITORY https://github.com/FFmpeg/nv-codec-headers.git + GIT_TAG ${NV_CODEC_HEADERS_13_1_TAG} + DOWNLOAD_ONLY YES +) diff --git a/src/config.cpp b/src/config.cpp index 04341dfdf1e..bb7fb94c2d0 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -64,6 +64,10 @@ namespace config { namespace nv { + std::string ffmpeg_preset_from_quality(const int quality_preset) { + return "p" + std::to_string(quality_preset); + } + /** * @brief Parse the `nvenc_twopass` configuration value. * @@ -1619,12 +1623,12 @@ namespace config { bool_f(vars, "nvenc_latency_over_power", video.nv_sunshine_high_power_mode); #if !defined(__ANDROID__) && !defined(__APPLE__) - video.nv_legacy.preset = video.nv.quality_preset + 11; + video.nv_legacy.preset = nv::ffmpeg_preset_from_quality(video.nv.quality_preset); video.nv_legacy.multipass = video.nv.two_pass == nvenc::nvenc_two_pass::quarter_resolution ? NV_ENC_TWO_PASS_QUARTER_RESOLUTION : video.nv.two_pass == nvenc::nvenc_two_pass::full_resolution ? NV_ENC_TWO_PASS_FULL_RESOLUTION : NV_ENC_MULTI_PASS_DISABLED; video.nv_legacy.h264_coder = video.nv.h264_cavlc ? NV_ENC_H264_ENTROPY_CODING_MODE_CAVLC : NV_ENC_H264_ENTROPY_CODING_MODE_CABAC; - video.nv_legacy.aq = video.nv.adaptive_quantization; + video.nv_legacy.spatial_aq = video.nv.adaptive_quantization; video.nv_legacy.vbv_percentage_increase = video.nv.vbv_percentage_increase; #endif diff --git a/src/config.h b/src/config.h index 317c55deea4..78615387365 100644 --- a/src/config.h +++ b/src/config.h @@ -17,6 +17,16 @@ #include "nvenc/nvenc_config.h" namespace config { + namespace nv { + /** + * @brief Convert Sunshine's NVENC quality preset number to FFmpeg's stable symbolic name. + * + * @param quality_preset Validated Sunshine quality preset in the range 1 through 7. + * @return FFmpeg preset name from `p1` through `p7`. + */ + std::string ffmpeg_preset_from_quality(int quality_preset); + } // namespace nv + // Valid range for the packetsize limit constexpr int PACKETSIZE_MIN = 200; ///< Lowest accepted configured packet size in bytes. constexpr int PACKETSIZE_MAX = 65535; ///< Highest accepted configured packet size in bytes. @@ -73,10 +83,10 @@ namespace config { bool nv_sunshine_high_power_mode; ///< Request NVIDIA high-power mode for Sunshine. struct { - int preset; ///< Legacy NVENC preset selection. + std::string preset; ///< FFmpeg NVENC preset name shared by supported FFmpeg versions. int multipass; ///< Legacy NVENC multipass mode. int h264_coder; ///< Legacy NVENC H.264 entropy-coding mode. - int aq; ///< Legacy NVENC adaptive-quantization mode. + int spatial_aq; ///< FFmpeg NVENC spatial adaptive-quantization mode. int vbv_percentage_increase; ///< Legacy NVENC VBV buffer-size percentage increase. } nv_legacy; ///< Legacy NVIDIA encoder options kept for config compatibility. diff --git a/src/nvenc/nvenc_dynamic_factory.cpp b/src/nvenc/nvenc_dynamic_factory.cpp index bc40d0c368c..87ee5179233 100644 --- a/src/nvenc/nvenc_dynamic_factory.cpp +++ b/src/nvenc/nvenc_dynamic_factory.cpp @@ -78,6 +78,14 @@ namespace nvenc { const auto max_version = decode_nvenc_driver_version(packed_max_version); const auto sdk_version = select_nvenc_sdk_version(max_version); switch (sdk_version) { + case nvenc_sdk_version::sdk_13_1: + return std::make_shared( + std::move(dll), + sdk_version, + detail::create_nvenc_d3d11_native_1301, + detail::create_nvenc_d3d11_on_cuda_1301 + ); + case nvenc_sdk_version::sdk_13_0: return std::make_shared( std::move(dll), diff --git a/src/nvenc/nvenc_dynamic_factory_versions.h b/src/nvenc/nvenc_dynamic_factory_versions.h index 4ac273b681e..061038a826e 100644 --- a/src/nvenc/nvenc_dynamic_factory_versions.h +++ b/src/nvenc/nvenc_dynamic_factory_versions.h @@ -62,6 +62,22 @@ namespace nvenc::detail { * @return SDK-neutral encoder instance. */ std::unique_ptr create_nvenc_d3d11_on_cuda_1300(ID3D11Device *device, shared_dll dll); + /** + * @brief Create an SDK 13.1 native Direct3D11 encoder. + * + * @param device Direct3D11 device used for encoding. + * @param dll Shared NVENC driver module. + * @return SDK-neutral encoder instance. + */ + std::unique_ptr create_nvenc_d3d11_native_1301(ID3D11Device *device, shared_dll dll); + /** + * @brief Create an SDK 13.1 CUDA-interoperability encoder. + * + * @param device Direct3D11 device used for input surfaces. + * @param dll Shared NVENC driver module. + * @return SDK-neutral encoder instance. + */ + std::unique_ptr create_nvenc_d3d11_on_cuda_1301(ID3D11Device *device, shared_dll dll); } // namespace nvenc::detail #endif diff --git a/src/nvenc/nvenc_sdk.h b/src/nvenc/nvenc_sdk.h index 5479da4c529..813090d8899 100644 --- a/src/nvenc/nvenc_sdk.h +++ b/src/nvenc/nvenc_sdk.h @@ -16,7 +16,7 @@ * @brief NVENC SDK version used while generating documentation. */ // Doxygen must select the same preprocessor interface used by versioned build targets. - #define NVENC_SDK_VERSION 1300 // NOSONAR(cpp:S5028) + #define NVENC_SDK_VERSION 1301 // NOSONAR(cpp:S5028) #endif #ifndef NVENC_NAMESPACE diff --git a/src/nvenc/nvenc_version.h b/src/nvenc/nvenc_version.h index 2058a0abdac..5092b171a1b 100644 --- a/src/nvenc/nvenc_version.h +++ b/src/nvenc/nvenc_version.h @@ -18,6 +18,7 @@ namespace nvenc { sdk_11_0 = 1100U, ///< Video Codec SDK 11.0. sdk_12_0 = 1200U, ///< Video Codec SDK 12.0. sdk_13_0 = 1300U, ///< Video Codec SDK 13.0. + sdk_13_1 = 1301U, ///< Video Codec SDK 13.1. }; /** @@ -38,6 +39,9 @@ namespace nvenc { */ constexpr nvenc_sdk_version select_nvenc_sdk_version(std::uint32_t max_version) { using enum nvenc_sdk_version; + if (max_version >= std::to_underlying(sdk_13_1)) { + return sdk_13_1; + } if (max_version >= std::to_underlying(sdk_13_0)) { return sdk_13_0; } diff --git a/src/video.cpp b/src/video.cpp index 6e99ada4ce4..0dca6747ad5 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -786,7 +786,7 @@ namespace video { {"tune"s, NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY}, {"rc"s, NV_ENC_PARAMS_RC_CBR}, {"multipass"s, &config::video.nv_legacy.multipass}, - {"aq"s, &config::video.nv_legacy.aq}, + {"spatial-aq"s, &config::video.nv_legacy.spatial_aq}, }, {}, // SDR-specific options {}, // HDR-specific options @@ -807,7 +807,7 @@ namespace video { {"tune"s, NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY}, {"rc"s, NV_ENC_PARAMS_RC_CBR}, {"multipass"s, &config::video.nv_legacy.multipass}, - {"aq"s, &config::video.nv_legacy.aq}, + {"spatial-aq"s, &config::video.nv_legacy.spatial_aq}, }, { // SDR-specific options @@ -834,7 +834,7 @@ namespace video { {"rc"s, NV_ENC_PARAMS_RC_CBR}, {"coder"s, &config::video.nv_legacy.h264_coder}, {"multipass"s, &config::video.nv_legacy.multipass}, - {"aq"s, &config::video.nv_legacy.aq}, + {"spatial-aq"s, &config::video.nv_legacy.spatial_aq}, }, { // SDR-specific options diff --git a/tests/unit/test_config.cpp b/tests/unit/test_config.cpp index 9055c44b6bc..a608aefd367 100644 --- a/tests/unit/test_config.cpp +++ b/tests/unit/test_config.cpp @@ -15,6 +15,35 @@ #include #include +using namespace std::literals; + +using NvencPresetNameParam = std::pair; + +/** + * @brief Parameterized coverage for FFmpeg's symbolic NVENC preset names. + */ +struct NvencPresetNameTest: testing::TestWithParam {}; + +TEST_P(NvencPresetNameTest, UsesStableSymbolicName) { + const auto &[quality_preset, expected] = GetParam(); + + EXPECT_EQ(expected, config::nv::ffmpeg_preset_from_quality(quality_preset)); +} + +INSTANTIATE_TEST_SUITE_P( + NvencQualityPresets, + NvencPresetNameTest, + testing::Values( + NvencPresetNameParam {1, "p1"sv}, + NvencPresetNameParam {2, "p2"sv}, + NvencPresetNameParam {3, "p3"sv}, + NvencPresetNameParam {4, "p4"sv}, + NvencPresetNameParam {5, "p5"sv}, + NvencPresetNameParam {6, "p6"sv}, + NvencPresetNameParam {7, "p7"sv} + ) +); + namespace { /** diff --git a/tests/unit/test_nvenc_dynamic_factory.cpp b/tests/unit/test_nvenc_dynamic_factory.cpp index 11841d3e351..4b3637dca0e 100644 --- a/tests/unit/test_nvenc_dynamic_factory.cpp +++ b/tests/unit/test_nvenc_dynamic_factory.cpp @@ -145,7 +145,8 @@ namespace { std::pair {11U << 4U, sdk_11_0}, std::pair {12U << 4U, sdk_12_0}, std::pair {13U << 4U, sdk_13_0}, - std::pair {14U << 4U, sdk_13_0}, + std::pair {(13U << 4U) | 1U, sdk_13_1}, + std::pair {14U << 4U, sdk_13_1}, }; reported_status = 0U; @@ -163,7 +164,7 @@ namespace { const auto dll = make_fake_dll(); nvenc::nvenc_dynamic_factory factory { dll, - nvenc::nvenc_sdk_version::sdk_13_0, + nvenc::nvenc_sdk_version::sdk_13_1, [&created_native, &dll](ID3D11Device *, nvenc::shared_dll callback_dll) { created_native = true; EXPECT_EQ(callback_dll, dll); @@ -176,7 +177,7 @@ namespace { }, }; - EXPECT_EQ(factory.sdk_version(), nvenc::nvenc_sdk_version::sdk_13_0); + EXPECT_EQ(factory.sdk_version(), nvenc::nvenc_sdk_version::sdk_13_1); EXPECT_TRUE(factory.create_nvenc_d3d11_native(nullptr)); EXPECT_TRUE(factory.create_nvenc_d3d11_on_cuda(nullptr)); EXPECT_TRUE(created_native); diff --git a/tests/unit/test_nvenc_version.cpp b/tests/unit/test_nvenc_version.cpp index 077feefc5d8..daa39f264da 100644 --- a/tests/unit/test_nvenc_version.cpp +++ b/tests/unit/test_nvenc_version.cpp @@ -40,8 +40,8 @@ namespace { nvenc_version_test_case {1201U, sdk_12_0}, nvenc_version_test_case {1299U, sdk_12_0}, nvenc_version_test_case {1300U, sdk_13_0}, - nvenc_version_test_case {1301U, sdk_13_0}, - nvenc_version_test_case {1400U, sdk_13_0}, + nvenc_version_test_case {1301U, sdk_13_1}, + nvenc_version_test_case {1400U, sdk_13_1}, }; for (const auto &[max_version, expected] : test_cases) { diff --git a/tests/unit/test_video.cpp b/tests/unit/test_video.cpp index 3d36b2e49c5..a7f04260848 100644 --- a/tests/unit/test_video.cpp +++ b/tests/unit/test_video.cpp @@ -7,6 +7,7 @@ // standard includes #include +#include #include #include #include @@ -65,6 +66,33 @@ INSTANTIATE_TEST_SUITE_P( } ); +#if !defined(_WIN32) && !defined(__APPLE__) +TEST(NvencAvcodecOptionsTest, UsesVersionStablePresetAndSpatialAqNames) { + const std::array codecs { + &video::nvenc.av1, + &video::nvenc.hevc, + &video::nvenc.h264, + }; + + for (const auto *codec : codecs) { + const auto preset = std::ranges::find(codec->common_options, "preset"sv, &video::encoder_t::option_t::name); + ASSERT_NE(codec->common_options.end(), preset); + ASSERT_TRUE(std::holds_alternative(preset->value)); + EXPECT_EQ(&config::video.nv_legacy.preset, std::get(preset->value)); + + const auto spatial_aq = std::ranges::find(codec->common_options, "spatial-aq"sv, &video::encoder_t::option_t::name); + ASSERT_NE(codec->common_options.end(), spatial_aq); + ASSERT_TRUE(std::holds_alternative(spatial_aq->value)); + EXPECT_EQ(&config::video.nv_legacy.spatial_aq, std::get(spatial_aq->value)); + + EXPECT_EQ( + codec->common_options.end(), + std::ranges::find(codec->common_options, "aq"sv, &video::encoder_t::option_t::name) + ); + } +} +#endif + TEST_P(EncoderTest, ValidateEncoder) { // todo:: test something besides fixture setup } From e46c925e48645148aef1de35a4ed7578eb7d4c54 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 9 Sep 2026 20:03:02 -0400 Subject: [PATCH 2/4] Bump build-deps --- CMakeLists.txt | 5 +++ cmake/dependencies/nv_codec_headers.cmake | 7 ++++ package-lock.cmake | 46 +-------------------- packaging/linux/flatpak/modules/ffmpeg.json | 8 ++-- third-party/build-deps | 2 +- 5 files changed, 18 insertions(+), 50 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6adf3fe6799..6821588ddd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,11 @@ if(${END_BUILD}) return() endif() +# Build-deps owns the dependency versions shared with its FFmpeg builds. +# Include its lock only for full builds so manifest-only configurations do not +# require the build-deps submodule. +include(${CMAKE_CURRENT_SOURCE_DIR}/third-party/build-deps/package-lock.cmake) + # project constants include(${CMAKE_MODULE_PATH}/prep/constants.cmake) diff --git a/cmake/dependencies/nv_codec_headers.cmake b/cmake/dependencies/nv_codec_headers.cmake index a80a1e84801..d66289a5cac 100644 --- a/cmake/dependencies/nv_codec_headers.cmake +++ b/cmake/dependencies/nv_codec_headers.cmake @@ -1,3 +1,7 @@ +# Keep build-deps-owned declarations out of Sunshine's generated package lock. +set(SUNSHINE_CPM_PACKAGE_LOCK_ENABLED "${CPM_PACKAGE_LOCK_ENABLED}") +set(CPM_PACKAGE_LOCK_ENABLED OFF) + if(NOT APPLE) CPMGetPackage(nv_codec_headers_13_1) set(NV_CODEC_HEADERS_13_1_INCLUDE_DIR "${nv_codec_headers_13_1_SOURCE_DIR}/include") @@ -12,3 +16,6 @@ if(WIN32) set(NV_CODEC_HEADERS_12_INCLUDE_DIR "${nv_codec_headers_12_SOURCE_DIR}/include") set(NV_CODEC_HEADERS_13_INCLUDE_DIR "${nv_codec_headers_13_SOURCE_DIR}/include") endif() + +set(CPM_PACKAGE_LOCK_ENABLED "${SUNSHINE_CPM_PACKAGE_LOCK_ENABLED}") +unset(SUNSHINE_CPM_PACKAGE_LOCK_ENABLED) diff --git a/package-lock.cmake b/package-lock.cmake index befdc328e41..b1bc09022d9 100644 --- a/package-lock.cmake +++ b/package-lock.cmake @@ -31,48 +31,4 @@ # - `set(EXAMPLE_SHA256 )` # - `CPMDeclarePackage(...)` -set(PATCH_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/patches") - -# NVENC SDK 11.0 headers -# renovate: datasource=github-tags depName=FFmpeg/nv-codec-headers -# versioning=regex:^n(?11)\.(?0)\.(?\d+)\.(?\d+)$ -set(NV_CODEC_HEADERS_11_TAG n11.0.10.3) -CPMDeclarePackage(nv_codec_headers_11 - NAME nv_codec_headers_11 - GIT_REPOSITORY https://github.com/FFmpeg/nv-codec-headers.git - GIT_TAG ${NV_CODEC_HEADERS_11_TAG} - DOWNLOAD_ONLY YES -) - -# NVENC SDK 12.0 headers -# renovate: datasource=github-tags depName=FFmpeg/nv-codec-headers -# versioning=regex:^n(?12)\.(?0)\.(?\d+)\.(?\d+)$ -set(NV_CODEC_HEADERS_12_TAG n12.0.16.2) -CPMDeclarePackage(nv_codec_headers_12 - NAME nv_codec_headers_12 - GIT_REPOSITORY https://github.com/FFmpeg/nv-codec-headers.git - GIT_TAG ${NV_CODEC_HEADERS_12_TAG} - DOWNLOAD_ONLY YES -) - -# NVENC SDK 13.0 headers -# renovate: datasource=github-tags depName=FFmpeg/nv-codec-headers -# versioning=regex:^n(?13)\.(?0)\.(?\d+)\.(?\d+)$ -set(NV_CODEC_HEADERS_13_TAG n13.0.19.1) -CPMDeclarePackage(nv_codec_headers_13 - NAME nv_codec_headers_13 - GIT_REPOSITORY https://github.com/FFmpeg/nv-codec-headers.git - GIT_TAG ${NV_CODEC_HEADERS_13_TAG} - DOWNLOAD_ONLY YES -) - -# NVENC SDK 13.1 headers -# renovate: datasource=github-tags depName=FFmpeg/nv-codec-headers -# versioning=regex:^n(?13)\.(?1)\.(?\d+)\.(?\d+)$ -set(NV_CODEC_HEADERS_13_1_TAG n13.1.15.0) -CPMDeclarePackage(nv_codec_headers_13_1 - NAME nv_codec_headers_13_1 - GIT_REPOSITORY https://github.com/FFmpeg/nv-codec-headers.git - GIT_TAG ${NV_CODEC_HEADERS_13_1_TAG} - DOWNLOAD_ONLY YES -) +set(PATCH_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/patches") diff --git a/packaging/linux/flatpak/modules/ffmpeg.json b/packaging/linux/flatpak/modules/ffmpeg.json index 21367998fec..ec51c40bc02 100644 --- a/packaging/linux/flatpak/modules/ffmpeg.json +++ b/packaging/linux/flatpak/modules/ffmpeg.json @@ -8,8 +8,8 @@ "sources": [ { "type": "file", - "url": "https://github.com/LizardByte/build-deps/releases/download/v2026.905.170812/Linux-x86_64-ffmpeg.tar.gz", - "sha256": "880f0b9983ea9b55a6cceb2e5afa6388e256751f3cac2baf4ef0cf6eedc57aea", + "url": "https://github.com/LizardByte/build-deps/releases/download/v2026.909.231827/Linux-x86_64-ffmpeg.tar.gz", + "sha256": "73b16095191ca0e9ad9a144d3325e85e4575dcd16d1e7b2826226c70df877ad7", "dest-filename": "ffmpeg.tar.gz", "only-arches": [ "x86_64" @@ -23,8 +23,8 @@ }, { "type": "file", - "url": "https://github.com/LizardByte/build-deps/releases/download/v2026.905.170812/Linux-aarch64-ffmpeg.tar.gz", - "sha256": "096069f2737a93ff44ba6445b700213708ab1fec01fd015e528a47845b5fde46", + "url": "https://github.com/LizardByte/build-deps/releases/download/v2026.909.231827/Linux-aarch64-ffmpeg.tar.gz", + "sha256": "6cc513d4fff3b95e5d2a070ce882f8dad59673799c872d9d152c499fc2c33a23", "dest-filename": "ffmpeg.tar.gz", "only-arches": [ "aarch64" diff --git a/third-party/build-deps b/third-party/build-deps index 2068aef7a16..dd62691439f 160000 --- a/third-party/build-deps +++ b/third-party/build-deps @@ -1 +1 @@ -Subproject commit 2068aef7a1612adb9782ed02066467752b0b0cb6 +Subproject commit dd62691439fe1a62efef57106eb55e4ad6a63bf8 From 2937607811d0bd658ad636fa5a22631b1aff0fd6 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 9 Sep 2026 20:49:16 -0400 Subject: [PATCH 3/4] Sonar and flatpak fixes --- cmake/dependencies/nv_codec_headers.cmake | 15 +++++++++++++-- src/config.cpp | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cmake/dependencies/nv_codec_headers.cmake b/cmake/dependencies/nv_codec_headers.cmake index d66289a5cac..a30c86eff58 100644 --- a/cmake/dependencies/nv_codec_headers.cmake +++ b/cmake/dependencies/nv_codec_headers.cmake @@ -3,8 +3,19 @@ set(SUNSHINE_CPM_PACKAGE_LOCK_ENABLED "${CPM_PACKAGE_LOCK_ENABLED}") set(CPM_PACKAGE_LOCK_ENABLED OFF) if(NOT APPLE) - CPMGetPackage(nv_codec_headers_13_1) - set(NV_CODEC_HEADERS_13_1_INCLUDE_DIR "${nv_codec_headers_13_1_SOURCE_DIR}/include") + set(SUNSHINE_PREPARED_NV_CODEC_HEADERS + "${FFMPEG_PREPARED_BINARIES}/include/ffnvcodec/nvEncodeAPI.h") + + if(DEFINED FFMPEG_PREPARED_BINARIES AND EXISTS "${SUNSHINE_PREPARED_NV_CODEC_HEADERS}") + # Prepared FFmpeg bundles include the NV codec headers used to build them. + set(NV_CODEC_HEADERS_13_1_INCLUDE_DIR "${FFMPEG_PREPARED_BINARIES}/include") + message(STATUS "Using NV codec headers from prepared FFmpeg binaries") + else() + CPMGetPackage(nv_codec_headers_13_1) + set(NV_CODEC_HEADERS_13_1_INCLUDE_DIR "${nv_codec_headers_13_1_SOURCE_DIR}/include") + endif() + + unset(SUNSHINE_PREPARED_NV_CODEC_HEADERS) endif() if(WIN32) diff --git a/src/config.cpp b/src/config.cpp index bb7fb94c2d0..2911deae016 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -65,7 +65,7 @@ namespace config { namespace nv { std::string ffmpeg_preset_from_quality(const int quality_preset) { - return "p" + std::to_string(quality_preset); + return std::format("p{}", quality_preset); } /** From 30f7386997e43ef4327f95c5d44134052a4acf6a Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 10 Sep 2026 10:43:27 -0400 Subject: [PATCH 4/4] Bump build-deps --- packaging/linux/flatpak/modules/ffmpeg.json | 8 ++++---- third-party/build-deps | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packaging/linux/flatpak/modules/ffmpeg.json b/packaging/linux/flatpak/modules/ffmpeg.json index ec51c40bc02..bc2efefc389 100644 --- a/packaging/linux/flatpak/modules/ffmpeg.json +++ b/packaging/linux/flatpak/modules/ffmpeg.json @@ -8,8 +8,8 @@ "sources": [ { "type": "file", - "url": "https://github.com/LizardByte/build-deps/releases/download/v2026.909.231827/Linux-x86_64-ffmpeg.tar.gz", - "sha256": "73b16095191ca0e9ad9a144d3325e85e4575dcd16d1e7b2826226c70df877ad7", + "url": "https://github.com/LizardByte/build-deps/releases/download/v2026.910.121303/Linux-x86_64-ffmpeg.tar.gz", + "sha256": "496d2bbb674d01e6033e31b9dfc15cbc9dc1494e882a4505f6ab1e03f75b385c", "dest-filename": "ffmpeg.tar.gz", "only-arches": [ "x86_64" @@ -23,8 +23,8 @@ }, { "type": "file", - "url": "https://github.com/LizardByte/build-deps/releases/download/v2026.909.231827/Linux-aarch64-ffmpeg.tar.gz", - "sha256": "6cc513d4fff3b95e5d2a070ce882f8dad59673799c872d9d152c499fc2c33a23", + "url": "https://github.com/LizardByte/build-deps/releases/download/v2026.910.121303/Linux-aarch64-ffmpeg.tar.gz", + "sha256": "21f99409e1aba09191f9df28688fb7f9d44f98e65378a651324c632c19823aa0", "dest-filename": "ffmpeg.tar.gz", "only-arches": [ "aarch64" diff --git a/third-party/build-deps b/third-party/build-deps index dd62691439f..a1fe2841cbc 160000 --- a/third-party/build-deps +++ b/third-party/build-deps @@ -1 +1 @@ -Subproject commit dd62691439fe1a62efef57106eb55e4ad6a63bf8 +Subproject commit a1fe2841cbc0d8c4501a1006d2d1cb88f219cc8c