aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-03-21 20:36:04 +0100
committerdec05eba <dec05eba@protonmail.com>2024-03-21 20:36:04 +0100
commit1e466832b4d65e1dca54afb6214250ca86f63e7d (patch)
treea17ae24bfbbba20bcd2b1b0cc61c37c7a315957b /src
parent08622c0712502bafb57514a414ed22845b729e6f (diff)
Workaround issue in older ffmpeg version with av1 nvenc causing the whole application to crash
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index e6c3be8..8e1723d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -561,6 +561,12 @@ static const AVCodec* find_h265_encoder(gsr_gpu_vendor vendor, const char *card_
}
static const AVCodec* find_av1_encoder(gsr_gpu_vendor vendor, const char *card_path) {
+ // Workaround bug with av1 nvidia in older ffmpeg versions that causes the whole application to crash
+ // when avcodec_open2 is opened with av1_nvenc
+ if(vendor == GSR_GPU_VENDOR_NVIDIA && LIBAVCODEC_BUILD < AV_VERSION_INT(60, 30, 100)) {
+ return nullptr;
+ }
+
const AVCodec *codec = avcodec_find_encoder_by_name(vendor == GSR_GPU_VENDOR_NVIDIA ? "av1_nvenc" : "av1_vaapi");
if(!codec)
codec = avcodec_find_encoder_by_name(vendor == GSR_GPU_VENDOR_NVIDIA ? "nvenc_av1" : "vaapi_av1");