Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions ffmpeg/ffmpeg.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"os"
"path"
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion install_ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down