sudo apt install libc6-dev libnuma-dev yasm nasm libtool
# libx264
git clone https://code.videolan.org/videolan/x264.git
cd x264
git checkout stable
./configure --enable-pic --enable-static
make && make install
# libx265
git clone https://bitbucket.org/multicoreware/x265_git.git
cd x265_git/build/linux
git checkout stable
cmake ../../source/ -DENABLE_SHARED=OFF -DENABLE_PIC=ON
make && make install
# nv-codec-headers
git clone https://github.com/FFmpeg/nv-codec-headers.git
cd nv-codec-headers
git checkout n11.1.5.3
make && make install
# ffmpeg 支持flv h265
git clone --recursive https://github.com/ZLMediaKit/FFmpeg.git
cd FFmpeg
./configure --prefix=/usr/local --enable-pic --enable-static --enable-shared --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-libx264 --enable-libx265 --enable-gpl --disable-libxcb
# 若出现ERROR: x265 not found using pkg-config,追加如下配置
--pkg-config-flags="--static" --extra-libs="-lpthread"
ffmpeg build with cuda、static x264/265
于 2020-08-23 00:27:47 首次发布