FFmpeg给FLV文件加水印

1. 安装yasm

wget http://www.tortall.net/projects/yasm/releases/yasm-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://ffmpeg.arrozcru.org/forum/viewtopic.php?f=8&t=1400
http://blog.linuxphp.org/archives/1388/

上一篇: debian5编译安装 ffmpeg   下一篇: mp4,flv在线视频的拖动播放

提交疑问

回顶部