FFmpeg 添加水印

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


居中添加水印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.mp4code


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


遇到問題
[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:1class


解決
拷貝C:\Windows\Fonts目錄下須要的字體到程序執行的目錄下stream

相關文章
相關標籤/搜索