8

It can be image watermark or text watermark. I would prefer text watermark though. I am unable to find a good solution to the above problem. Kindly help me. Video format will be mostly a MP4 H.264 file. Resolutions of the files may vary. If I can do this in batch that's good but as of now I am fine with doing it to a single video file. Thank You

SamSi
  • 81
  • 1
  • 1
  • 2

1 Answers1

14

Two options I found:

  1. Using ffmpeg:

     ffmpeg -i input.mp4 -i watermark.png -filter_complex "overlay=1500:1000" output.mp4
    
  2. Using avconv:

     avconv -i input.mp4 -i watermark.png -filter_complex 'overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10' output.mp4
    

Information:

ffmpeg's overlay= option allows me to specify where the top left of the image will appear on the video. So adjust those number based on the resolution of your watermark and of your video. Specifying a specific position of the overlay in pixels – 10:10 puts the video 10 pixels from the top and 10 pixels from the left. (x:y coordinates)

avconv has a more complex syntax. It's possible to specify the absolute position using overlay=x=1500:y=1000 or to use relative positions with overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10.

Source:

https://shkspr.mobi/blog/2016/08/easy-ways-to-add-watermarks-to-images-and-videos-in-linux/

http://ksloan.net/watermarking-videos-from-the-command-line-using-ffmpeg-filters/

George Udosen
  • 35,970
  • 13
  • 99
  • 121
  • 1
    A minor correction to the above: in ffmpeg, the overlay x coordinate counts from the LEFT, not the right. – Reuben Thomas Nov 04 '19 at 12:11
  • 1
    ffmpeg can also use `main_w`, `main_h`, `overlay_w`, and `overlay_h`. See the [overlay filter documentation](https://ffmpeg.org/ffmpeg-filters.html#overlay). – llogan Nov 06 '19 at 01:10