安装freetype-devel
[root@localhost ffmpeg-4.2]# yum install freetype-devel
安装freetype2
我下载的是freetype-2.3.5.tar.gz
[root@localhost zyl]# tar -xvf freetype-2.3.5.tar.gz
[root@localhost zyl]# cd freetype-2.3.5
[root@localhost zyl]# mkdir build
[root@localhost zyl]# ./configure --prefix=/home/zyl/freetype-2.3.5/build
[root@localhost zyl]# make clean;make
配置PKG_CONFIG_PATH
[root@localhost zyl]# export PKG_CONFIG_PATH=/home/zyl/freetype-2.3.5/build:$PKG_CONFIG_PATH
#重新配置ffmpeg
[root@localhost ffmpeg-4.2]# ./configure --prefix=/home/zyl/ffmpeg-4.2/build --enable-libfreetype --disable-x86asm
[root@localhost ffmpeg-4.2]# make clean;make;make install
#使用dramtex滤镜
./ffmpeg -i xxx.ts -vf “drawtext=xxx” output.ts