Add a Watermark to a Video with ffmpeg

FAIL (the browser should render some flash content, not this).

Download in .ogv format


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Easy in LiVES 1.3.3

salsaman's picture

Sorry Mitch, no time to make that video guide yet ! But I am happy to say that as of LiVES 1.3.3, this is really easy, since I added the Image Overlay effect into the main distro.

1) Open your video in LiVES from the File menu

2) Making sure you are in Clip Edit mode (if in multitrack, press ctrl-e), select Effects -> Image Overlay. Choose your image file/logo (it can be any type of image, including png with alpha). Select the start position, image size (or use natural size), and start alpha (0 for fully opaque). Select end position, end size and end alpha (so you can make it move around or fade in/out). Click OK.

3) After the effect has completed, select File -> Encode clip as, and encode the updated clip.

Unfortunately LiVES cannot

David Nolen's picture

Unfortunately LiVES cannot rapidly open AVCHD files and has some massive deal breakers as I noted over on its article here:

I tried Kdenlive which was the most promising, but the amount of bugs that thing has, coupled with a requirement to recompile FFMPeg to use AAC and H264 (which still doesn't give you the ability to encode in those formats...I'm waiting for an answer on WHY that is on their forums even after spending some time looking for and implementing various answers) as well as the fact that even when using MTS formats the damn thing can't even keep the audio and video in sync, that program is a waste of time. Open Movie Editor doesn't work. Cindellerra can't open the files, and already transcoded files it can't do anything with (not to mention playback of audio is jacked up). Blender tells me FFMPeg can't understand the file.

Basically I've gone through nearly every single video editing solution on Linux and not one of them, not a one, can do the simple task of adding a watermark to the video file I'm trying to create without a deal breaking caveat. AVIDemux used to be everything I needed, but then they just removed the Logo function without informing anyone, and after nearly a year (or more) still no word on its restoration.

I'm really wondering if there's a product out there that works at all, given that even the pay for stuff on windows is so buggy as to make it unuseable. I feel like I did when I first started with DV files and nothing worked to edit those.

i used Avisynth, but i'm a

Minh's picture

i used Avisynth, but i'm a windows user :D

Heh, this is all well and

David Nolen's picture

Heh, this is all well and good, but now vhook isn't even included in my ditro. It's gone completely to libavfilter, which is fine if I could figure out how to make that do the same thing as vhook when applying a watermark. There does not appear to be any useable way of including a watermark in linux anymore. AVIDemux removed their support for 'logos' and the libavfilter documentation looks to be Greek to me in regards to actually making it do something useful. Kino was mentioned as a possibility, but the shear amount of time it takes for the kinds of video files I deal with makes it impractical. Other options like building a custom build of ffmpeg with vhook still in (if I understood the suggestion on the Ubuntu boards correctly) is a place I'd rather not go on my system. Any suggestions at this point?


Mitch Frazier's picture

I haven't found a great solution yet. You can take a look at this article, it works although it does have some limitations. Check the comments also as there are some suggestions there that you might want to investigate also.

One would hope that the vhook replacement would see the light of day soon.

Mitch Frazier is an Associate Editor for Linux Journal.

Works Sort Of

Thomas Bond's picture

Hi All,

Got the watermarking to work sort of. I have the watermark but I also have a gray cast to the original video. Looks like the 808080 background is not transparent. Any ideas?



Check Your Image

Mitch Frazier's picture

For reference, the purpose of the 808080 is described below (taken from the ffmpeg documentation):

The watermark picture works like this (assuming color intensities 0..0xFF): Per color do this: If mask color is 0x80, no change to the original frame. If mask color is < 0x80 the absolute difference is subtracted from the frame. If result < 0, result = 0. If mask color is > 0x80 the absolute difference is added to the frame. If result > 0xFF, result = 0xFF.

The only thing I can think of is that you've got a problem with the image and it's not in the format that you think it is. Double check the background to make sure it's all 808080. Also make sure that the image is the same size as the video. The documentation doesn't state what, if anything, might be done to an image that is of a different size than the video before it's used to watermark the video.

This is a known good watermark image, try it and see what you get from it.

Mitch Frazier is an Associate Editor for Linux Journal.

Images From Videos

videocaptures's picture

Fast video indexer is a video capture software that can capture video frames automatically from a list of videos and create index web pages, index pictures or a list of images.

ffmpeg removed support for

Artem Russakovskii's picture

ffmpeg removed support for vhook a while ago, at least in SVN, in favor of libavfilter. You can see the note here: Therefore, this vhook idea isn't going to work unless you are using an old version of ffmpeg, and it's no longer supported anyway. :(

Not that Old

Mitch Frazier's picture

It was deprecated in the 0.5 version that was released in March of this year and won't be removed until the next version.

Mitch Frazier is an Associate Editor for Linux Journal.