FFmpeg给FLV文件加水印
1. 安装ya易做图wget http://www.tortall.net/projects/ya易做图/releases/ya易做图-1.1.0.tar.gz
./configure
make
make install
2.编译FFmpeg支持movie 和avfilter
svn co svn://svn.ffmpeg.org/soc/libavfilter
cd libavfilter
./checkout.sh
cd ffmpeg
./configure --enable-filter=movie --enable-avfilter
make && make install
增加水印
简单使用
ffmpeg -i in.flv -vf "movie=0:png:logo.png [wm];[in][wm] overlay=250:10:1 [out]" out.flv
增强画质
ffmpeg -i in.flv -vcodec libx264 -qmin 10 -qmax 51 -qdiff 4 -me_range 16 -keyint_min 25 -qcomp 0.6 -b 1500K -vf "movie=0:png:logo.png [wm];[in][wm] overlay=250:10:1 [out]" out.flv
如果开启了x264可使用
ffmpeg -i in.flv -qmin 10 -qmax 51 -qdiff 4 -me_range 16 -keyint_min 25 -qcomp 0.6 -b 1500K -vf "movie=0:png:logo.png [wm];[in][wm] overlay=250:10:1 [out]" out.flv
上面其中overlay的值250和10分别代表水印的横纵坐标
参考:
http://blog.linuxphp.org/archives/1388/