Kaptain.
Telegram /
LinkedIn /
Email /
GIT /
RSS /
GPG /

№ 11779 В разделе
Sysadmin
от July 6th, 2022,
В подшивках: Linux
Первое что нужно сделать это поставить дрова nvidia. Разумеется, без них ничего работать не будет. Тажке нужно поставить дополнительные зависимости для сборки ffmpeg:
sudo apt-get install build-essential yasm cmake libtool libc6 libc6-dev unzip wget libnuma1 libnuma-dev nvidia-cuda-toolkit
Теперь можно смело идти сюда и выполнять сборку под вашу ОС https://docs.nvidia.com/video-technologies/video-codec-sdk/ffmpeg-with-nvidia-gpu/.
На всякий случай копипастну сюда:
FFmpeg with NVIDIA GPU acceleration is supported on all Linux platforms.
To compile FFmpeg on Linux, do the following:
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers && sudo make install && cd –
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg/
sudo apt-get install build-essential yasm cmake libtool libc6 libc6-dev unzip wget libnuma1 libnuma-dev
./configure --enable-nonfree --enable-cuda-nvcc --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
Вы можете собрать новый пакет с вкомпиленой поддержкой cuda, но я не стал заморачиваться, поставил ffmpeg из репозитория и поверх него через make install катанул мою сборку. Да, оно захерится при следующем обновлении ОС, собирайте пакет и не смотрите какой я ленивый.
По ссылке выше даны примеры использования. А от себя могу показать такой способ для сливания кучи записей с рега в одну ffmpeg -i concat:"$(ls -1 | tr '\n' '|')" -c:a aac -c:v h264_nvenc -b:v 5M output.mp4
Fortune cookie: The cruelest of creatures' the crab With claws that can pinch you or stab, And then when you dine On crab and white wine It gets you as well with the tab.
Leave a Reply