Here is a quick way to add watermarks to photos and videos. All Linux command line based – so perfect if you’ve got a lot of images you want to manipulate.
Here is a delightful photo I’ve taken of a bee covered in pollen. I want to add a little copyright notice to it in order to discourage people using it without permission.
As you can see, a small watermark in the bottom right – specified using -gravity SouthEast. I’ve chosen a yellow colour for the font – in homage to the EURion anti-counterfeiting symbols.
The -annotate command contains the distance in pixels from the edges
For small text, I favour a Pixel Font like TinyUnicode – but feel free to choose one which suits your needs.
In this example, I position the message in the top left, with a larger font size, in pale blue, closer to the horizontal edge and further from the vertical edge.
Adding a watermark to a video is more complex. This will require either ffmpeg – which isn’t always installed by default on Linux – or avconv (I don’t pretend to understand why ffmpeg and avconv split – but there we are).
I am going to overlay a transparent image on top of the video.
I’ve created this watermark image with a transparent background.
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.
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.
So, there you have it – hopefully simple ways to watermark your media files.
Share this post on…
One thought on “Easy ways to add watermarks to images and videos in Linux”
2016-08-06 20:48 Bob Boberson says: For anyone else who read this and immediately asked themselves “but can I get ffmpeg to overlay it without re-encoding the video because my machine is old and slow and that’d take ages”, the answer is, no, you can’t.$ ffmpeg -i foo.mp4 -i yeah.png -filter_complex “overlay=100:100” -vcodec copy /tmp/watermarked.mp4Results in the error message: “Streamcopy requested for output stream 0:0, which is fed from a complex filtergraph. Filtering and streamcopy cannot be used together.”Makes sense, but I had to try it to stop myself wondering “but maybe…”.
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptRead More
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.