1、安装freetype字体库,avfilter添加文字水印的依赖项;
下载freetype:https://www.freetype.org/download.html;
配置、编译、安装、读取版本信息
./configure
make
sudo make install
踩坑
1、gmake 错误
GNU make (>= 3.81) or makepp (>= 2.0) is required to build FreeType2.
Please try
MAKE=<GNU make command name> ./configure
or
MAKE="makepp --norc-substitution" ./configure
解决办法:
sudo apt install make
2、报错 no acceptable C compiler found in $PATH
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
2、x264安装
下载x264https://www.videolan.org/developers/x264.html
配置、编译、安装
./configure
make
sudo make install
踩坑:
1、提示缺失nasm
Found no assembler
Minimum version is nasm-2.13
If you really want to compile without asm, configure with --disable-asm.
解决办法:
执行sudo apt-get install nasm后,再进行配置
3、编译ffmpeg
下载 https://github.com/FFmpeg/FFmpeg
配置、编译
./configure --prefix=/home/tal/Document/ffmpeg/FFmpeg-n4.3.1/build/ --enable-static --enable-shared --enable-libfreetype --enable-gpl --enable-libx264 --enable-encoder=libx264 --enable-decoder=h264
make
踩坑:
1、ERROR: libx264 not found
解决办法:
编译安装 x264 时 增加选项 --enable-shared
./configure --enable-shared