Skip to content

Instantly share code, notes, and snippets.

@dcbark01
Created October 4, 2025 17:24
Show Gist options
  • Select an option

  • Save dcbark01/61245f96adde16ed95809bdac63702aa to your computer and use it in GitHub Desktop.

Select an option

Save dcbark01/61245f96adde16ed95809bdac63702aa to your computer and use it in GitHub Desktop.
Install FFMPEG with CUDA support

Install FFMPEG with CUDA support

See Nvidia FFMPEG install docs here. I had to modify their instructions slightly to avoid issues with A100 cards.

git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers && sudo make install && cd –
git clone --branch release/7.1 https://git.ffmpeg.org/ffmpeg.git ffmpeg/

Add libx264-dev also to enable x264 support

sudo apt update && apt-get install build-essential yasm cmake libtool libc6 libc6-dev unzip wget libnuma1 libnuma-dev libx264-dev
./configure --enable-nonfree --enable-cuda-nvcc --enable-libx264 --enable-gpl --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --disable-static --enable-shared
make -j 8
sudo make install

Make sure to run this to make sure library paths are updated

sudo ldconfig

Then to test (the examples in the Nvidia docs don't work)

ffmpeg -i example-001.mp4 -c:a copy -c:v libx264 -preset fast -b:v 5M example-001-out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment