From 1e466832b4d65e1dca54afb6214250ca86f63e7d Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 21 Mar 2024 20:36:04 +0100 Subject: Workaround issue in older ffmpeg version with av1 nvenc causing the whole application to crash --- src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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"); -- cgit v1.2.3