3

How do I add a watermark or logo to a video using mencoder?

2

You need the bmovl (Bitmap Overlay) option

   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

I know the OP asked how on mencoder but it is rather complicated and doesn't work on any newer versions of Linux I've tried. The info, commands and sources are what I turned to after troubleshooting and failing to make bmovl on mencoder work. I get an error of " mencoder bmovl error vf_bmovl: Unknown command: ''. Ignoring."

What I recommend is using ffmpeg:

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

If using Linux Mint ffmpeg is missing from default repos so you'll need to read this about installing a third party PPA to get it going.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.