What is the easiest way to add watermark to a video?
Two options I found:
-
Using
ffmpeg
:ffmpeg -i input.mp4 -i watermark.png -filter_complex "overlay=1500:1000" output.mp4
-
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 withoverlay=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/
Related videos on Youtube
SamSi
Updated on September 18, 2022Comments
-
SamSi over 1 year
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
-
Reuben Thomas over 4 yearsA minor correction to the above: in ffmpeg, the overlay x coordinate counts from the LEFT, not the right.
-
llogan over 4 years