在 mencoder 中为视频添加水印/徽标

在 mencoder 中为视频添加水印/徽标

如何使用 mencoder 为视频添加水印或徽标?

答案1

你需要bmovl(位图叠加)选项

   bmovl=hidden:opaque:fifo
          The bitmap overlay filter reads bitmaps from a FIFO and displays
          them  on  top of the movie, allowing some transformations on the
          image.  Also see TOOLS/bmovl-test.c for a small bmovl test  proâ€
          gram.
             <hidden>
                  Set  the  default value of the ’hidden’ flag (0=visible,
                  1=hidden).
             <opaque>
                  Set the default value of the ’opaque’ flag  (0=transparâ€
                  ent, 1=opaque).
             <fifo>
                  path/filename   for  the  FIFO  (named  pipe  connecting
                  ’mplayer -vf bmovl’ to the controlling application)

          FIFO commands are:
             RGBA32 width height xpos ypos alpha clear
                  followed by width*height*4 Bytes of raw RGBA32 data.
             ABGR32 width height xpos ypos alpha clear
                  followed by width*height*4 Bytes of raw ABGR32 data.
             RGB24 width height xpos ypos alpha clear
                  followed by width*height*3 Bytes of raw RGB24 data.
             BGR24 width height xpos ypos alpha clear
                  followed by width*height*3 Bytes of raw BGR24 data.
             ALPHA width height xpos ypos alpha
                  Change alpha transparency of the specified area.
             CLEAR width height xpos ypos
                  Clear area.
             OPAQUE
                  Disable all alpha transparency.  Send "ALPHA 0 0 0 0  0"
                  to enable it again.
             HIDE
                  Hide bitmap.
             SHOW
                  Show bitmap.

          Arguments are:
             <width>, <height>
                  image/area size
             <xpos>, <ypos>
                  Start blitting at position x/y.
             <alpha>
                  Set  alpha  difference.  If you set this to -255 you can
                  then send a sequence of ALPHA-commands to set  the  area
                  to -225, -200, -175 etc for a nice fade-in-effect! ;)
                     0:    same as original
                     255:  Make everything opaque.
                     -255: Make everything transparent.

             <clear>
                  Clear the framebuffer before blitting.
                     0:  The  image will just be blitted on top of the old
                     one, so you do not need to send 1.8MB of RGBA32  data
                     every time a small part of the screen is updated.
                     1: clear

答案2

我知道 OP 询问了如何在 mencoder 上使用它,但它相当复杂,而且在我尝试过的任何较新版本的 Linux 上都不起作用。在排除故障并无法使 mencoder 上的 bmovl 工作后,我转向了这些信息、命令和来源。我收到错误“ mencoder bmovl 错误 vf_bmovl: 未知命令:“”。忽略。"

我建议使用 ffmpeg:

ffmpeg -i  yourvideo.mp4 -i yourwatermark.jpg -filter_complex "overlay=10:10" outputfile.mp4

如果使用 Linux Mint ffmpeg 时默认存储库中缺少该插件,则需要阅读有关安装第三方 PPA 以使其运行的信息。

相关内容