FFmpeg添加水印

在左上角添加水印fengyuzaitu
ffmpegd.exe -i video.mp4 -vf drawtext=fontfile=arial.ttf:text=fengyuzaitu output.mp4

我们提供的服务有:成都网站建设、成都网站制作、微信公众号开发、网站优化、网站认证、新华ssl等。为1000多家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的新华网站制作公司

居中添加水印fengyuzaitu
ffmpegd.exe -i video.mp4 -vf drawtext=fontfile=arial.ttf:x=w/2:y=h/2:text=fengyuzaitu output.mp4

指定水印颜色和宽度
ffmpegd.exe -i video.mp4 -vf drawtext=fontfile=arial.ttf:x=w/2:y=h/2:fontsize=24:fontcolor=yellow:text=fengyuzaitu output.mp4

添加当前时间戳
ffmpegd.exe  -i video.mp4 -vf drawtext="fontfile=arial.ttf:text='%{localtime\:%H\\\:%M\\\:%S}'" output.mp4

遇到问题
[Parsed_drawtext_0 @ 0000015FE818EE80] Cannot find a valid font for the family Sans
[AVFilterGraph @ 0000015FE6473A80] Error initializing filter 'drawtext' with args 'fontfile=arial.ttf:text=fengyuzaitu'
Error reinitializing filters!
Failed to inject frame into filter network: No such file or directory
Error while processing the decoded data for stream #0:1

解决
拷贝C:\Windows\Fonts目录下需要的字体到程序执行的目录下


分享题目:FFmpeg添加水印
本文网址:http://pwwzsj.com/article/jgeoog.html