安装Cuda 10.2的toolkit和对应的NVIDIA显卡驱动, 后安装nvidea codec的头文件:
https://github.com/FFmpeg/nv-codec-headers/releases
下载后解压:
tar xf nv-codec-headers-n10.0.26.0.tar.gz
cd nv-codec-headers-n10.0.26.0
make
make install
在CentOS 7.8下, 下载ffmpeg版本:
http://ffmpeg.org/download.html#releases
下载ffmpeg4.2.4到CentOS7.8上:
http://ffmpeg.org/releases/ffmpeg-4.2.4.tar.xz
tar xf ffmpeg-4.2.4.tar.xz
cd ffmpeg-4.2.4
编译参考: https://developer.nvidia.com/ffmpeg
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --enable-cuda-nvcc --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
make -j10
make install
来源:oschina
链接:https://my.oschina.net/michaelshu/blog/4355724