How to install FFmpeg with NVIDIA GPU acceleration on Linux

How to install FFmpeg with NVIDIA GPU acceleration on Linux

To install FFmpeg with NVIDIA GPU acceleration on Linux, you can use the following steps:

  1. 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.

  2. 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.

  3. 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.

  4. Change to the FFmpeg directory:
    cd ffmpeg-4.4.1

  5. Configure FFmpeg:
    ./configure --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp
    This enables GPU acceleration and various other FFmpeg features.

  6. Build and install FFmpeg:
    make
    sudo make install
    This builds and installs FFmpeg on your system.

Created Time:2017-10-16 14:38:47  Author:lautturi