Technology consulting for creative industries

Using FFmpeg to add and watermark / overlay on a video

Using FFmpeg to add and watermark / overlay on a video

By on Jul 22, 2010 in Corbell Consulting, News | 6 comments

Since moving to version 0.6 in June 2010 vhooks are no longer available in FFmpeg. It seems like a lot of people are having trouble getting watermarks working properly with the new libavfilter method. I’ll lay out here the steps that I took to get it working properly on Mac OS X. I’ve tested this on 10.6.4 and 10.5.8 with great results.

First off, there are a number of add-ons you’ll likely want to load. For each of these just download the latest source. I was able to simply run ./configure, make, make install for each of these with no hiccups.

I’d recommend that you start by creating a folder in your home directory called Source. Uncompress all of these to that Source folder and keep all your work in there.

yasm (
faac (
lame (
x264 (

If you’re going to be dealing with ProRes files, you can use these qt_tools to convert them to a format that FFmpeg can work with. Worth downloading and installing.

qt_tools (

Finally, you’ll want to get the latest version of libavfilter. Open the Terminal and cd into your Source directory.

svn co svn://

Next, cd into libavfilter and run

Then, cd into the ffmpeg directory and run ./configure to prepare your build. On Leopard I used this command:

./configure --enable-avfilter --enable-libmp3lame --enable-shared --disable-mmx \
 --arch=x86_32 --enable-libfaac --enable-nonfree --enable-filter=movie --enable-avfilter-lavf \
 --enable-libx264 --enable-gpl

On Snow Leoapard I ran this. The only difference being 64 bit support:

./configure --enable-avfilter --enable-libmp3lame --enable-shared --disable-mmx \
--arch=x86_64 --enable-libfaac --enable-nonfree --enable-filter=movie --enable-avfilter-lavf \
--enable-libx264 --enable-gpl

Assuming you are still error-free, you can now run `make` and when that finishes, `make install`.

Whew, the scary stuff is done. Now you have qt_tools which will let you get out of ProRes format and the latest greatest version of FFmpeg with support for AAC audio, MP3 Audio, h.264 video encoding and watermarking.

To use qt_export you have to create a settings file which it will use to decode your video. In the terminal type `qt_export –dodialog –savesettings=mySettings.qts` This will open the Quicktime export dialog box. You can go ahead and select all the settings you want to use. When you click OK it will create a file called mySettings.qts or whatever you put in the terminal command. You only have to do this once. The next command is what you use to process a video file.

qt_export --loadsettings=mySettings.qts

So that will take, convert it to whatever settings you saved in the mySettings.qts file and spit out

Finally, this command is what you use to overlay your watermark. In this example, the watermark file is the same frame size as the video. I’m using a PNG file with transparency. You’ll want to go through and setup your ffmpeg parameters for whatever your application may be. I’m outputting a 15Mbit MP4 file, 720p with 256kbit AAC audio.

ffmpeg -i -f mp4  -b 15M -acodec libfaac -ab 256k  \
-vf "movie=0:png:preview.png [wm];[in][wm] overlay=0:0:1 [out]" out.mp4

That should do it!

Here’s a sample video I encoded using the following command. It’s a nice, crappy, very compressed file.

ffmpeg -i -s 640x360 -f mp4  -b 800k -acodec libfaac \
-ab 64k  -vf "movie=0:png:watermark-half.png [wm];[in][wm] overlay=0:0:1 [out]" out.mp4

[qt: 640 360]


  1. Did they remove a bunch of the filters from libavfilter? movie and overlay don’t seem to be included anymore… I am on FFmpeg version SVN-r24735 and keep getting ‘”No such filter: ‘movie'” when running movie=0:png:preview.png [wm];[in][wm] overlay=0:0:1 [out]


    August 7, 2010

  2. Cameron: Make sure to build ffmpeg with –enable-movie.

    Ask Bjørn Hansen

    October 11, 2010

  3. Eh – actually:

    The ffmpeg change log says the following — so I guess this whole how-to isn’t right. 🙂

    commit 2268cf99feee1c1af824204ea55434f80e8c4c51
    Author: stefano
    Date: Wed Jul 28 08:56:49 2010 +0000

    Remove reference to the unexisting movie filter and the corresponding
    useless –enable-avfilter-lavf option.

    git-svn-id: file:///var/local/repositories/ffmpeg/trunk@24569 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

    Ask Bjørn Hansen

    October 11, 2010

  4. Thanks for posting this up! It was a huge help, especially since there’s not a ton of info on libavfilter out there, and especially not from an OS X standpoint.

    I used the latest SVN for libavfilter, x264, and ffmpeg. The only thing I had to change from your instructions was to remove the “-lavf” from the “–enable-avfilter-lavf” build parameter. Not sure what the difference is, but the overlay filter seems to work regardless.

    Thanks again!


    October 28, 2010

  5. FYI. On the most recent version of OSX 10.6.5 and the latest version of Xcode along with XCode 4 you will need to run this before you configure…

    export CFLAGS=”-arch x86_64 -Wconversion -Wformat -Wshorten-64-to-32 -mmacosx-version-min=10.5″

    After a week of banging my head against a brick wall I managed to compile it succesfully

    Gavin Williams

    December 10, 2010

  6. How about a Windows binary with the watermarking? If someone has it, please send me a link at noahsw AT

    Thanks in advance!


    June 23, 2011


  1. Need Step By Step Tutorial For FFMPEG Hardcoded Watermark - BuyScripts Forums - [...] below.... **FIRST BACKUP YOUR FILES** install FFmpeg 0.6 ( I used Google and found this site Using…

Post a Reply

Your email address will not be published. Required fields are marked *