ifx0
V2EX  ›  问与答

ffmpeg 加水印命令求助,有偿

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

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

    Sunyanzi
        1
    Sunyanzi  
       Feb 28, 2021
    啊哈这个我会 ... 头像即微信 ...
    ifx0
        2
    ifx0  
    OP
       Feb 28, 2021
    @Sunyanzi 已加微信
    witfun
        3
    witfun  
       Feb 28, 2021
    说说我自己加水印的方法(轻喷
    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
        4
    ifx0  
    OP
       Feb 28, 2021
    @witfun 不好意思哈,已被一楼捷足先登了。
    witfun
        5
    witfun  
       Feb 28, 2021
    @ifx0 #4 没,我也只是分享一下自己的方法
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5324 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 08:06 · PVG 16:06 · LAX 01:06 · JFK 04:06
    ♥ Do have faith in what you're doing.