参考
https://developer.nvidia.com/ffmpeg
下载头文件
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git cd nv-codec-headers sudo make sudo make install libav git clone https://github.com/libav/libav
重新编译
export PATH=/usr/local/cuda/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH make clean NV_CODEC=`pwd`/../Video_Codec_SDK_9.1.23 ./configure \ --prefix=/usr/local \ --enable-shared \ --enable-gpl \ --enable-cuda --enable-cuvid --enable-nvenc \ --enable-nonfree \ --extra-cflags="-I${NV_CODEC}/include -I/usr/local/include -I/usr/local/cuda/include" \ --extra-ldflags="-L${NV_CODEC}/Lib/linux/stubs/x86_64 -L/usr/local/lib -L/usr/local/cuda/lib64" # --enable-libnpp \ # --enable-libx264 \ make sudo make install
测试