From a70333b46389d2574d70f77513ed8efb357e164f Mon Sep 17 00:00:00 2001 From: Eli Mallon Date: Tue, 23 Jan 2024 00:28:19 +0000 Subject: [PATCH 1/2] ffmpeg: move back to scale_cuda from scale_npp --- ffmpeg/ffmpeg.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/ffmpeg/ffmpeg.go b/ffmpeg/ffmpeg.go index 38410203c0..bb22a51e68 100755 --- a/ffmpeg/ffmpeg.go +++ b/ffmpeg/ffmpeg.go @@ -9,7 +9,6 @@ import ( "os" "path" "path/filepath" - "runtime" "strconv" "strings" "sync" @@ -1115,21 +1114,11 @@ func ffmpegStrEscape(origStr string) string { } func hwScale() string { - if runtime.GOOS == "windows" { - // we don't build windows binaries with CUDA SDK, so need to use scale_cuda instead of scale_npp - return "scale_cuda" - } else { - return "scale_npp" - } + return "scale_cuda" } func hwScaleAlgo() string { - if runtime.GOOS == "windows" { - // we don't build windows binaries with CUDA SDK, so need to use the default scale algorithm - return "" - } else { - return "super" - } + return "" } func FfmpegSetLogLevel(level int) { From 14374dfade45b0775b54d4a5ebbb8e3464ec9d85 Mon Sep 17 00:00:00 2001 From: Strykar <2946372+Strykar@users.noreply.github.com> Date: Tue, 12 May 2026 09:39:16 +0530 Subject: [PATCH 2/2] install_ffmpeg.sh: drop libnpp, allow nvcc gencode override scale_cuda replaces scale_npp. CUDA 13 dropped compute_60; default preserved for CUDA 11/12, override via env for newer SDKs. --- install_ffmpeg.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install_ffmpeg.sh b/install_ffmpeg.sh index 55108ab75c..595bb4f4a8 100755 --- a/install_ffmpeg.sh +++ b/install_ffmpeg.sh @@ -197,7 +197,9 @@ elif [[ "$GOOS" == "windows" ]]; then EXTRA_FFMPEG_FLAGS="$EXTRA_FFMPEG_FLAGS --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvenc --enable-decoder=h264_cuvid,hevc_cuvid,vp8_cuvid,vp9_cuvid --enable-filter=scale_cuda,signature_cuda,hwupload_cuda --enable-encoder=h264_nvenc,hevc_nvenc" elif [[ -e "/usr/local/cuda/lib64" ]]; then echo "CUDA SDK detected, building with GPU support" - EXTRA_FFMPEG_FLAGS="$EXTRA_FFMPEG_FLAGS --enable-nonfree --enable-cuda-nvcc --enable-libnpp --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvenc --enable-decoder=h264_cuvid,hevc_cuvid,vp8_cuvid,vp9_cuvid --enable-filter=scale_npp,signature_cuda,hwupload_cuda --enable-encoder=h264_nvenc,hevc_nvenc" + # libnpp is restructured/dropped in CUDA 13 and is otherwise nonfree; + # scale_cuda replaces scale_npp without needing it. + EXTRA_FFMPEG_FLAGS="$EXTRA_FFMPEG_FLAGS --enable-nonfree --enable-cuda-nvcc --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvenc --enable-decoder=h264_cuvid,hevc_cuvid,vp8_cuvid,vp9_cuvid --enable-filter=scale_cuda,signature_cuda,hwupload_cuda --enable-encoder=h264_nvenc,hevc_nvenc" else echo "No CUDA SDK detected, building without GPU support" fi @@ -231,6 +233,7 @@ if [[ ! -e "$ROOT/ffmpeg/libavcodec/libavcodec.a" ]]; then --extra-cflags="${EXTRA_CFLAGS} -I${ROOT}/compiled/include -I/usr/local/cuda/include" \ --extra-ldflags="${EXTRA_FFMPEG_LDFLAGS} -L${ROOT}/compiled/lib -L/usr/local/cuda/lib64" \ --prefix="$ROOT/compiled" \ + --nvccflags="-gencode arch=${NVCC_GENCODE_ARCH:-compute_60},code=${NVCC_GENCODE_SM:-sm_60} -O2 -std=c++11 -m64 -ptx" \ $EXTRA_FFMPEG_FLAGS \ $DEV_FFMPEG_FLAGS || (tail -100 ${ROOT}/ffmpeg/ffbuild/config.log && exit 1) # If configure fails, then print the last 100 log lines for debugging and exit.