ifx0
V2EX  ›  问与答

ffmpeg 加水印命令求助,有偿

  •  
  •   ifx0 · Feb 28, 2021 · 2200 views
    This topic created in 2092 days ago, the information mentioned may be changed or developed.

    ffmpeg 文档太复杂,难以入门,特求助 给 mp4 视频加上文字水印,文字水印位置每隔 10 多秒随机变动。 有偿 300 元

    Sunyanzi
    Sunyanzi
    Feb 28, 2021
    1
    啊哈这个我会 ... 头像即微信 ...
    ifx0
    ifx0
    OP
    Feb 28, 2021
    2
    @Sunyanzi 已加微信
    witfun
    witfun
    Feb 28, 2021
    3
    说说我自己加水印的方法(轻喷 :
    ffmpeg -threads 1 -i source.mp4 -vf "drawtext=fontfile=msyh.ttf:fontsize=15:[email protected]:text='水印内容':x=10:y=15:enable='between(mod(t\,30*4),0,30)', drawtext=fontfile=msyh.ttf:fontsize=15:[email protected]:text='水印内容':x=1135:y=15:enable='between(mod(t\,30*4),31,60)', drawtext=fontfile=msyh.ttf:fontsize=15:[email protected]:text='水印内容':x=10:y=695:enable='between(mod(t\,30*4),61,90)', drawtext=fontfile=msyh.ttf:fontsize=15:[email protected]:text='水印内容':x=1135:y=695:enable='between(mod(t\,30*4),91,120)'" -c:v libx264 -crf 23 -c:a copy result.mp4

    这是四角的水印,其中 x,y 分别为 帧宽度减 145 、帧高度-25,这需要根据 fontsize 和 text 长度自己慢慢调整。
    每 30s 切换 between(mod(t\,30*4),31,60) 各参数意义很容易猜出来
    ifx0
    ifx0
    OP
    Feb 28, 2021
    4
    @witfun 不好意思哈,已被一楼捷足先登了。
    witfun
    witfun
    Feb 28, 2021
    5
    @ifx0 #4 没,我也只是分享一下自己的方法
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2018 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 06:27 · PVG 14:27 · LAX 22:27 · JFK 01:27
    ♥ Do have faith in what you're doing.