用 FFmpeg 给视频添加水印 Logo(overlay 滤镜)

一条 ffmpeg 命令把 PNG 标志烙进视频角落,不需要视频编辑软件。

Windows视频水印FFmpeg低风险
运行 ffmpeg -i input.mp4 -i logo.png -filter_complex "overlay=W-w-20:H-h-20" output.mp4,Logo 会固定在右下角。

01命令

命令
$ ffmpeg -i input.mp4 -i logo.png -filter_complex "overlay=W-w-20:H-h-20" output.mp4

02作用说明

overlay 滤镜把第二个输入(你的 Logo)叠在第一个输入(视频)之上。W-w-20:H-h-20 表示距右边缘和下边缘各 20 像素;改成 20:20 就是左上角,(W-w)/2:(H-h)/2 则是居中。视频需要重新编码一次,长视频要等几分钟。

03风险

风险低风险
使用条件FFmpeg is not preinstalled on Windows — install it first with: winget install --id Gyan.FFmpeg
!注意: Logo 必须用带透明通道的 PNG——不透明的 JPG 会像贴纸一样把画面盖住;输出体积偏大时可调 -crf。

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • overlay — FFmpeg Filters Documentation
    FFmpeg · vendor-doc · 2026-09-17
    依据: Documents the overlay filter and the W-w/H-h expressions for placing the overlay relative to the main video's edges.
  • OverlayFilter — FFmpeg Trac Wiki
    FFmpeg Trac Wiki · community · 2026-09-17
    依据: Shows practical examples of watermarking a video with a PNG logo using the overlay filter.

最后验证: 2026-09-18 · 分类: 媒体