From 98b00cdb3d44af95c1b93a9b9596b6032c5ddb8d Mon Sep 17 00:00:00 2001 From: 21pages Date: Mon, 30 Dec 2024 11:51:36 +0800 Subject: [PATCH] Fix image blur occurring at the moment of changing quality (#10399) 1. Fix this issue occurs on FFmepg qsv, FFmpeg nvenc and SDK mfx, other codecs don't have this problem. Clear cache is needed. Signed-off-by: 21pages --- Cargo.lock | 2 +- .../0009-fix-nvenc-reconfigure-blur.patch | 28 +++++++++++++++++++ res/vcpkg/ffmpeg/portfile.cmake | 1 + 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 res/vcpkg/ffmpeg/patch/0009-fix-nvenc-reconfigure-blur.patch diff --git a/Cargo.lock b/Cargo.lock index 21f9503858e6..a8cca450fab8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3065,7 +3065,7 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hwcodec" version = "0.7.1" -source = "git+https://github.com/rustdesk-org/hwcodec#3e7c0dc755f8a77bbed3b2a9921553a511fd7bb5" +source = "git+https://github.com/rustdesk-org/hwcodec#c4d6b1c5c4ddc7548868306004cf5d4eb614a36f" dependencies = [ "bindgen 0.59.2", "cc", diff --git a/res/vcpkg/ffmpeg/patch/0009-fix-nvenc-reconfigure-blur.patch b/res/vcpkg/ffmpeg/patch/0009-fix-nvenc-reconfigure-blur.patch new file mode 100644 index 000000000000..2e8aff64aa5a --- /dev/null +++ b/res/vcpkg/ffmpeg/patch/0009-fix-nvenc-reconfigure-blur.patch @@ -0,0 +1,28 @@ +From bec8d49e75b37806e1cff39c75027860fde0bfa2 Mon Sep 17 00:00:00 2001 +From: 21pages +Date: Fri, 27 Dec 2024 08:43:12 +0800 +Subject: [PATCH] fix nvenc reconfigure blur + +Signed-off-by: 21pages +--- + libavcodec/nvenc.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c +index 2cce478be0..f4c559b7ce 100644 +--- a/libavcodec/nvenc.c ++++ b/libavcodec/nvenc.c +@@ -2741,8 +2741,8 @@ static void reconfig_encoder(AVCodecContext *avctx, const AVFrame *frame) + } + + if (reconfig_bitrate) { +- params.resetEncoder = 1; +- params.forceIDR = 1; ++ params.resetEncoder = 0; ++ params.forceIDR = 0; + + needs_encode_config = 1; + needs_reconfig = 1; +-- +2.43.0.windows.1 + diff --git a/res/vcpkg/ffmpeg/portfile.cmake b/res/vcpkg/ffmpeg/portfile.cmake index b8e05e211cbd..1d46535d5ddf 100644 --- a/res/vcpkg/ffmpeg/portfile.cmake +++ b/res/vcpkg/ffmpeg/portfile.cmake @@ -24,6 +24,7 @@ vcpkg_from_github( patch/0006-dlopen-libva.patch patch/0007-fix-linux-configure.patch patch/0008-remove-amf-loop-query.patch + patch/0009-fix-nvenc-reconfigure-blur.patch ) if(SOURCE_PATH MATCHES " ")