Skip to content

Instantly share code, notes, and snippets.

@yoosefi
Last active April 10, 2022 21:04
Show Gist options
  • Save yoosefi/6c2b91a192398e5c17ea148672e36ac8 to your computer and use it in GitHub Desktop.
Save yoosefi/6c2b91a192398e5c17ea148672e36ac8 to your computer and use it in GitHub Desktop.
builds and installs ffmpeg with nvenc (debian)
#!/bin/bash
# builds and installs ffmpeg with nvenc (debian)
# install nv codec headers
if [ ! -d nv-codec-headers ]; then
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
fi
cd nv-codec-headers
git pull
sudo make install
cd -
# install ffmpeg deps
sudo apt build-dep ffmpeg
# build ffmpeg entirely in ram
mkdir -p ffmpeg
sudo umount ffmpeg
sudo mount -t tmpfs -o size=10G tmpfs ffmpeg
cd ffmpeg
apt source --compile ffmpeg
rm -v libavcodec-extra* libavfilter-extra*
if [ -f ../hold.lock ]; then
cat ../hold.lock | xargs apt unhold
fi
sudo dpkg -i *.deb
ls *.deb | cut -d_ -f1 > ../hold.lock
cat ../hold.lock | xargs apt hold
cd -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment