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
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
没试过。吾是集成到libav再调用。