To install FFmpeg with NVIDIA GPU acceleration on Linux, you can use the following steps:
Install the NVIDIA drivers:
Follow the instructions at https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html to install the NVIDIA drivers on your Linux system. This is required to enable GPU acceleration.
Install the dependencies for FFmpeg:sudo apt-get install build-essential nasm yasm pkg-config libtool libx264-dev libx265-dev libnuma-dev libvpx-dev libfdk-aac-dev libmp3lame-dev libopus-dev
This installs the required packages for building FFmpeg.
Download the FFmpeg source code:wget https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.bz2
tar xvf ffmpeg-4.4.1.tar.bz2
This downloads and extracts the FFmpeg source code to a directory called ffmpeg-4.4.1
.
Change to the FFmpeg directory:cd ffmpeg-4.4.1
Configure FFmpeg:./configure --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp
This enables GPU acceleration and various other FFmpeg features.
Build and install FFmpeg:make
sudo make install
This builds and installs FFmpeg on your system.