Install the NVIDIA driver for CUDA and other GPU-related tools:
- Version: nvidia-driver-535
sudo apt update
sudo apt-get install nvidia-driver-535
sudo reboot
sudo apt-get install nvidia-cuda-toolkit
Download and set up the NVIDIA Video Codec SDK:
- Version: Video_Codec_SDK_11.1.5
mkdir -p ~/ffmpeg_sources ~/bin
cd ~/ffmpeg_sources && git clone https://github.com/LuizStSantos/Video_Codec_SDK_11.1.5.git NV_Codec_SDK
mkdir -p ~/ffmpeg_sources/NV_SDK
cp -r NV_Codec_SDK/Interface ~/ffmpeg_sources/NV_SDK
Download the Desktop Video driver and Desktop Video SDK from the official Blackmagic website:
- Download Desktop Video and SDK
- Version: Blackmagic_Desktop_Video_Linux_14.0.1
tar -xf Blackmagic_Desktop_Video_Linux_*.tar
cd Blackmagic_Desktop_Video_Linux_*/deb/x86_64/
sudo dpkg -i desktopvideo_*.deb
sudo apt-get install -f
BlackmagicFirmwareUpdater status
# If prompted to update the firmware, perform the update
BlackmagicFirmwareUpdater update 0
# If prompted to reboot, reboot the system
sudo reboot
- Version: Blackmagic_DeckLink_SDK_14.0
sudo apt install unzip
unzip Blackmagic_DeckLink_SDK_*.zip
cp -r Blackmagic\ DeckLink\ SDK\ */Linux/ ~/ffmpeg_sources/BMD_SDK
sudo apt-get update -qq && sudo apt-get -y install \
autoconf automake build-essential cmake git-core \
libass-dev libfreetype6-dev libgnutls28-dev libmp3lame-dev \
libtool libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev \
meson ninja-build pkg-config texinfo wget zlib1g-dev libharfbuzz-dev \
libfontconfig-dev libfribidi-dev libzmq5-dev
For audio and video encoding:
sudo apt-get -y install nasm yasm libx264-dev libx265-dev \
libnuma-dev libvpx-dev libunistring-dev libfdk-aac-dev \
libmp3lame-dev libopus-dev libssl-dev libdav1d-dev
ffnvcodec:
- Version: On Videolan
cd ~/ffmpeg_sources
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers
sudo make install
cd
libsrt:
- Version: On Github
cd ~/ffmpeg_sources
git clone https://github.com/Haivision/srt.git
cd srt
./configure
make -j$(nproc)
sudo make install
cd
SVT-AV1:
- Version: SVT-AV1-v2.2.0
cd ~/ffmpeg_sources
wget https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v2.2.0/SVT-AV1-v2.2.0.zip
unzip SVT-AV1-v2.2.0.zip
cp -r SVT-AV1-v2.2.0 ~/ffmpeg_sources/SVT-AV1
cd SVT-AV1
mkdir build
cd build
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
sudo make install
cd
- Version: ffmpeg-7.0
cd ~/ffmpeg_sources
wget -c https://ffmpeg.org/releases/ffmpeg-7.0.tar.bz2
tar -xvf ffmpeg-*.tar.bz2
cd ffmpeg-*/
Configure FFmpeg with the necessary options for DeckLink and other codecs:
PATH="$HOME/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/lib:/usr/lib:/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
./configure \
--prefix="$HOME/ffmpeg_build" \
--pkg-config-flags="--static" \
--extra-cflags="-I$HOME/ffmpeg_build/include -I$HOME/ffmpeg_sources/BMD_SDK/include -I/usr/local/cuda/include -I$HOME/ffmpeg_sources/NV_SDK/Interface" \
--extra-ldflags="-L$HOME/ffmpeg_build/lib -L/usr/local/cuda/lib64 -L$HOME/ffmpeg_sources/NV_SDK/Lib/linux/stubs/x86_64" \
--extra-libs="-lpthread -lm" \
--ld="g++" \
--bindir="$HOME/bin" \
--enable-gpl \
--enable-libass \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libharfbuzz \
--enable-libfontconfig \
--enable-libfribidi \
--enable-libzmq \
--enable-libmp3lame \
--enable-libopus \
--enable-libvorbis \
--enable-openssl \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-libsvtav1 \
--enable-libdav1d \
--enable-libsrt \
--enable-nonfree \
--enable-decklink \
--enable-cuda \
--enable-cuvid \
--enable-nvenc \
--enable-nvdec \
--enable-libnpp \
--enable-cuda-nvcc \
--enable-ffnvcodec \
--enable-cuda-llvm
Finally, compile and install FFmpeg:
PATH="$HOME/bin:$PATH" make -j$(nproc)
sudo cp ffmpeg ffprobe /usr/local/bin/