背景
windows下构建失败,ffmpeg对于flv-h265的处理得到新的报错。
开始ubuntu22下编译
pre:清除我们之前编译的nightly版本
sudo rm -rf /usr/local/bin/ffmpeg
sudo rm -rf /usr/local/bin/ffprobe
sudo rm -rf /usr/local/bin/ffserver
sudo rm -rf /usr/local/lib/libav*
sudo rm -rf /usr/local/include/libav*
sudo rm -rf /usr/local/share/man/man1/ff*
sudo rm -rf /usr/local/share/ffmpeg
sudo rm -rf /usr/local/lib/pkgconfig/ff*
下载ffmpeg源码,切换到n7.1-dev分支
git clone https://github.com/FFmpeg/FFmpeg
cd FFmpeg
git checkout -b n7.1-dev
git switch -c n7.1-dev
编译安装x265
git clone https://bitbucket.org/multicoreware/x265_git.git
cd x265_git/build/linux./make-Makefiles.shmake -j 4 && make installexport PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
回到ffmpeg, 修改代码
- 文件1:libavformat\flv.h (一处修改)
- 文件2:libavformat\flvdec.c (三处修改)
- 文件3:libavformat\flvenc.c (三处修改)
开始编译
./configure --enable-static --disable-shared --disable-doc --enable-libx265 --enable-gpl --enable-nonfree --enable-openssl
make -j2