How to watermark a video using FFmpeg

ffmpeg This article explains how to add a watermark image to a video file using FFmpeg ( Typically a watermark is used to protect ownership/credit of the video and for Marketing/Branding the video with a Logo.  One of the most common areas where watermarks appear is the bottom right hand corner of a video.  I’m going to cover all four corners for you, since these are generally the ideal placements for watermarks.  Plus, if you want to get really creative I’ll let you in on an alternative.

FFmpeg is a free software / open source project that produces libraries and programs for handling multimedia such as video.  Many of it developers also are part of the MPlayer project.  Primarily this project is geared towards Linux OS, however, much of it has been ported over to work with Windows 32bit and 64bit.  FFmpeg is being utilized in a number of software applications; including web applications such as PHPmotion (  Not only does it provide handy tools, it also provided extremely useful features and functionality that can be added to a variety of software applications.

FFmpeg on Windows
If you want to use FFpmeg on Windows, I recommend checking out the FFmpeg Windows builds at Zeranoe ( for compiled binaries, executables and source code.  Everything you need to get FFmpeg working on Windows is there.  If you’re looking for a handy Windows GUI command line tool, check out WinFF  You can configure WinFF to work with whatever builds of FFmpeg you have installed on windows.  You can also customize you’re own presets (stored command lines) to work with FFpmeg. 

Getting familiar with it.
Perhaps one of the best ways to get familiar with using FFmpeg on windows is to create a .bat script file that you can modify and experiment with.  Retyping command lines over again from scratch becomes a tedious process, especially when working with an command line tool you’re trying to become more familiar with.  If you’re on Linux you’ll be working with shell scripts instead of .bat files.

Please keep in mind that FFmpeg has been, and still is, a rather experimental project.  Working with FFmpeg’s Command Line Interface (CLI) is not easy at first and will take some time getting familiar with it.  You need to be familiar with the basics of opening a video file, converting it, and saving the output to a new video file.  I strongly recommend creating and working with FFmpeg in shell/bat scripting files while learning the functionality of it’s Command Line Interface.

-vhook (Video Hook)
Please note that the functionality of “-vhook” (video hook) in older versions of FFmpeg has been replaced with “-vf” (video filters) libavfilter . You’ll need to use –vf instead of –vhook in the command line.  This applies to both Linux and Windows builds.

What we’re going to do
In a nutshell;  We’re going to load a .png image as a Video Source “Movie” and use the Overlay filter to position it. While it might seem a little absurd to load an image file as a Video Source “Movie” to overlay, this is the way it’s done. (i.e. movie=watermarklogo.png)

What’s awesome about working with png (portable network graphics) files is that they support background transparency and are excellent to use in overlaying on top of videos and other images.

The Overlay Filter  overlay=x:y
This filter is used to overlay one video on top of another. It accepts the parameters x:y.  Where x and y is the top left position of overlayed video on the main video.  In this case, the top left position of the watermark graphic on the main video. 

To position the watermark 10 pixels to the right and 10 pixels down from the top left corner of the main video, we would use “overlay=10:10”

The following expression variables represent the size properties of the Main and overlay videos.

  • main_w (main video width)
  • main_h (main video height)
  • overlay_w (overlay video width)
  • overlay_h  (overlay video hieght)

For example if the; main video is 640×360 and the overlay video is 120×60 then

  • main_w = 640
  • main_h = 360
  • overlay_w = 120
  • overlay_h = 60

We can get the actual size (width and height in pixels) of both the watermark and the video file, and use this information to calculate the desired positioning of things.  These properties are extremely handy for building expressions to programmatically set the x:y position of the overlay on top of the main video. (see examples below)

Watermark Overlay Examples


The following 4 video filter (-vf) examples embed an image named “watermarklogo.png” into one of the four corners of the video file, the image is placed 10 pixels away from the sides (offset for desired padding/margin).

Top left corner
ffmpeg –i inputvideo.avi -vf "movie=watermarklogo.png [watermark]; [in][watermark] overlay=10:10 [out]" outputvideo.flv

Top right corner
ffmpeg –i inputvideo.avi -vf "movie=watermarklogo.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]" outputvideo.flv

Bottom left corner
ffmpeg –i inputvideo.avi -vf "movie=watermarklogo.png [watermark]; [in][watermark] overlay=10:main_h-overlay_h-10 [out]" outputvideo.flv

Bottom right corner
ffmpeg –i inputvideo.avi -vf "movie=watermarklogo.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:main_h-overlay_h-10 [out]" outputvideo.flv

These examples use something known as Filter Chains.  The pad names for streams used in the filter chain are contained in square brackets [watermark],[in] and [out].  The ones labeled [in] and [out] are specific to video input and output.  The one labeled [watermark] is a custom name given to the stream for the video overlay.  You can change [watermark] to another name if you like.  We are taking the output of the [watermark] and merging it into the input [in] stream for final output [out].

Padding Filter vs. Offset
A padding filter is available to add padding to a video overlay (watermark), however it’s a little complicated and confusing to work with.  In the examples above I used an offset value of 10 pixels in the expressions for x and y. 

For instance, when calculating the x position for placing the watermark overlay to right side of the video, 10 pixels away from the edge.

<strong>or rather</strong> 
x=((main video width)-(watermark width)-(offset))

Another Watermark positioning Technique
Is to create a .png with same size as the converted video (ie. 640×360).  Set it’s background to being transparent and place your watermark/logo where you desire it to appear over top of the video.  This what’s known as a “full overlay”.   You can actually get rather creative with your watermark design and branding using this technique.

ffmpeg –i inputvideo.avi -vf "movie=watermarklogo.png [watermark]; [in][watermark] overlay=0:0 [out]" outputvideo.flv

Full command line example
This is a more realistic example of what a a full FFmpeg command line looks like with various switches enabled.  The examples in this article are extremely minified so you could get the basic idea. 

ffmpeg -i test.mts -vcodec flv -f flv -r 29.97 -aspect 16:9 -b 300k -g 160 -cmp dct -subcmp dct -mbd 2 -flags +aic+cbp+mv0+mv4 -trellis 1 -ac 1 -ar 22050 -ab 56k -s 640x360 -vf "movie=dv_sml.png [wm]; [in][wm] overlay=main_w-overlay_w-10:main_h-overlay_h-10 [out]" test.flv

Windows users – Please Note
On the Windows OS the file paths used in video filters, such as “C:\graphics\watermarklogo.png” should be modified to be “/graphics/watermarklogo.png”.  I myself experienced errors being thrown while using the Windows Builds of FFmpeg.  This behavior may or may not change in the future.  Please keep in mind that FFmeg is a Linux based project that has been ported over to work on Windows.

Watermarks and Branding in General
You can get some really great ideas for watermarking and branding by simply watching TV or videos online.  One thing that many people tend to over look is including their website address in the watermark.  Simply displaying it at the end or start of the video is not as effective.  So some important elements would be a Logo, perhaps even a phone number or email address.  The goal is to give people some piece of useful information for contacting or follow you. If you display it as part of your watermark, they have plenty of time to make note of your website URL, phone number or email address.  A well designed logo is effective as well.  The more professional looking your logo is, the more professional you come off as being to your audience.

If you are running a video portal service, and wish to brand the videos in conjunction/addition to watermark branding being done by your users.  It’s wise to pick a corner such as the top right or top left to display your watermark.  Perhaps go for far to give them an option of specifying which corner to display your watermark in, so it does not conflict with their own branding.  I thought this was worth wild to mention since FFmpeg is used in web applications such as PHPmotion. 

If you’re working with “full overlays” you can get pretty creative. You can get some really amazing ideas from watching the Major News networks on TV.  Even the Home shopping networks such as QVC.  These are just a few ideas for creative sources to watch and pull ideas from.

I’ve tried to make this article somewhat useful, however it’s by no means all encompassing.  If there is any interest, I have examples of how to chain a Text Draw Filter to display text along with a Watermark overlay. Even how to incorporate a video fade-in filter.  Working with filter chains can prove to be rather challenging at times.

Please feel free to post any comments and questions.

64 thoughts on “How to watermark a video using FFmpeg

  1. Luis Daniel Mesa

    I get this when i run it in ubuntu…

    Unrecognized option ‘vf’

    Any idea how to enable that functionality? Or any other way of watermarking from the command-line? Thanks.

    1. Chaz Scholton Post author

      Luis, you might be using an older version which supports the -vhook option instead of -vf. The only other thing I can think about is that the “libavfilter” library is not set up to be used in the particular build. Snag up the latest version at and check the documentation out there.

  2. Markus

    hi, great article – thanks. you write, “I have examples of how to chain a Text Draw Filter to display text along with a Watermark overlay. Even how to incorporate a video fade-in filter.”

    Please can you update the article with such examples for completeness! I’d love to see how to watermark text onto a video.

  3. Pavi

    Its really very good and helpful.
    Can you please tell me how can i set time-line for water mark, I mean i want the image should be appeared on particular time duration and disappeared after given time duration?
    Thank you for your help.

  4. KD

    Hi Chaz,

    When I tried the following:

    ffmpeg -i in.mpg -sameq -vf “movie=B240x180.png[o];[in][o]overlay=0:0[out]” out.mpg

    I got the following message:

    [movie @ 0xfaa720] init() expected 3 arguments:’B240x180.0.png’
    Error initializing filter ‘movie’ with args ‘B240x180.0.png’
    Error opening filters!

    I would really appreciate if you can tell what I did wrong.



  5. John

    Hi Chaz, excellent article but I have a question, what if I wanted to merge two video files, one being a watermark over the other ?

  6. Chaz Scholton Post author

    John, I would suggest working with Video Editing Software for more advanced Editing techniques. While FFMpeg is a powerful tool, there are still many features that don’t exist (as of yet). You might want to explore cutting the Video file up into 2 or more files, applying the watermark effect then splice the video files back together again. There are some advanced options in FFMpeg for Sub-Clips which I have not worked with yet. The general idea is to Slice up the main video file, apply the Watermark (or other effects) then Splice the video back together again. Hope this helps point you in some useful direction.

    1. Chaz Scholton Post author

      Baseem, look into using the -qmax setting. -qmax 1 is the same as using -sameq. The down side is that often flv files generated at high quality are rather large. Try experimenting with different -qmax settings such as (-qmax 6).

  7. Julian

    Hey chaz!

    Wondering if you could share the code for the text watermark! Would be greatly appreciated!

    Thanks for the awesome guide!! It worked straight with images :)

  8. Ozeefrogee

    Very good explanation !!!
    BUT !…
    While you can overlay an image.png with its alpha channel (transparency), or while you can overlay a ‘normal no-transparency’ watermark mask, you always obtain an output video WITHOUT transparency itself !!!
    Say that the image.png is a logo without transparency, and you overlay on a video, I would like to obtain an output video WITH a transparency that is the logo previsouly mentionned…
    Hope you understand.
    What is the ffmpeg script for that ?…
    THANX so much
    Plz write to
    Ozee ;))

    Hurrah to FREE softwares !

    1. Chaz Scholton Post author

      Hi Ozeefrogee, many of the Video Codacs in FFMeg don’t support video transparency yet. However .MOV does along with Motion .PNG. Hope this helps point you in the right direction.

  9. Rajuk

    I am getting error as
    [NULL @ 0215ABA0] Unable to find a suitable output format for ‘ΓÇôi’
    ΓÇôi: Invalid argument

    What might be the issue and should we specify something in the place [in] [out][watermark]

  10. Yorg

    Hi Chaz, great article! I was wondering if you knew how to hook into ffmpeg to check progress – let’s say you start the conversion process via a hyperlink, how would you hook in to get the current progress for the current conversion? Thanks!

  11. mrproper

    watermark works fine when output is a file, but it doesn’t seem to work when output is ffserver (.ffm)

  12. rahul gupta

    I just followed the instructions and it just worked !!! watermarking videos with ffmpeg used to be struggle earlier (2010) now its breeze thanks @author .

  13. Aneeq

    Watermarking an image in PHP is very easy. If you follow the code below, you can do it in 2 minutes.


    function watermarkImage ($SourceFile, $WaterMarkText, $DestinationFile) {
    //$SourceFile is source of the image file to be watermarked
    //$WaterMarkText is the text of the watermark
    //$DestinationFile is the destination location where the watermarked images will be placed

    //Delete if destinaton file already exists

    //This is the vertical center of the image
    $top = getimagesize($SourceFile);
    $top = $top[1]/2;
    list($width, $height) = getimagesize($SourceFile);

    $image_p = imagecreatetruecolor($width, $height);

    $image = imagecreatefromjpeg($SourceFile);

    imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width, $height);

    //Path to the font file on the server. Do not miss to upload the font file
    $font = ‘arial.ttf’;

    //Font sie
    $font_size = 16;

    //Give a white shadow
    $white = imagecolorallocate($image_p, 255, 255, 255);
    imagettftext($image_p, $font_size, 0, 10, $top, $white, $font, $WaterMarkText);

    //Print in black color
    $black = imagecolorallocate($image_p, 0, 0, 0);
    imagettftext($image_p, $font_size, 0, 8, $top-1, $black, $font, $WaterMarkText);

    if ($DestinationFile”) {

    imagejpeg ($image_p, $DestinationFile, 100);

    } else {

    header(‘Content-Type: image/jpeg’);

    imagejpeg($image_p, null, 100);







    $SourceFile = ‘image.jpg’;//Source image
    $DestinationFile = ‘watermarked/image.jpg’;//Destination path
    $WaterMarkText = ‘’;//Watermark text

    //Call the function to watermark the image
    watermarkImage ($SourceFile, $WaterMarkText, $DestinationFile);

    //Display watermarked image if desired
    echo “”;
    echo “The image has been watermarked at ‘”.$DestinationFile.”‘”;


    This code is being provided to you as a help by without any warranty and liability
    Place all the files in a folder on web server.
    Do not forget to upload the font file – arial.ttf.
    Once the image is watermarked, it will be placed in the folder named ‘watermarked’.
    You might need to give ‘write permission’ or ’777 permission’ to the folder named ‘watermarked’ as the new watermarked image will be written in this folder.


  14. Rubia

    Hi guys!!,
    It was pretty useful for me. Though I need to run text like marquee in my video. Can anyone pls suggest me any help.
    Thanks in advance .

  15. rams

    great job Chaz Scholton.
    i am working with mp4(h264) video recording project. i done video but metadata missing. what i do?

  16. Nologic

    A note about handling pathing on windows for the image file.

    The path must first be enclosed in single quotes.
    All back slashes must be converted to forward slashes. (as noted in tutorial)
    Colons must be escaped with back slashes.

    -vf “movie=’C\:/test/WaterMark.png’, scale=iw/2:ih/2[watermark];[in][watermark]overlay=10:10[out]”

    Okay the scale isn’t needed, but thought it would be a nice touch to add. :)

  17. Pingback: ffmpeg: unrecognized option '-vf' Error

  18. RT

    I was also receiving “Unable to find a suitable output format for ‘–i’”
    I found the answer from another forum, for a similar problem: The author used the en-dash instead of the hypen-minus (–, not -), so FFmpeg will choke on that and not recognize i as the input option.

    Just replace the hyphen in the code, with the correct type. Since I was copying and pasting, I’m guessing it got messed up along the way.

  19. waleed

    I’m not a programmer and really do not know how to do it.
    I’m using clip bucket 2.6 and i’m willing to pay you to do it for me.
    would you do it? if so contact me.

  20. manpreet

    very nice thankyou sir .i have a simple question
    when i used this watermar code this increased mine output video size (almost doubled)please provide me code for same size of output video .

  21. Marwane

    hello dear , thank you for the tut , but i have a problem adding watermark to my flv videos ,
    i have a video with a dimension of 708/396 , so i create a transparent png(water1.png) with a logo in it , and i excute this command :
    “ffmpeg -i Death_Note_01.flv -vf “movie=water1.png [watermark]; [in][watermark] overlay=10:10 [out]” Death_Note_01.flv_water.flv”

    and i get an error :
    [flv @ 0x2103300] Estimating duration from bitrate, this may be inaccurate
    Input #0, flv, from ‘Death_Note_01.flv’:
    duration : 1375
    width : 708
    height : 396
    videodatarate : 195
    framerate : 24
    videocodecid : 7
    audiodatarate : 62
    audiosamplerate : 22050
    audiosamplesize : 16
    stereo : true
    audiocodecid : 10
    encoder : Lavf53.2.0
    filesize : 49831490
    Duration: 00:22:54.95, start: 0.000000, bitrate: 264 kb/s
    Stream #0.0: Video: h264 (High), yuv420p, 708×396 [PAR 1:1 DAR 59:33], 200 kb/s, 23.98 tbr, 1k tbn, 47.95 tbc
    Stream #0.1: Audio: aac, 22050 Hz, stereo, s16, 64 kb/s
    [buffer @ 0x2107900] w:708 h:396 pixfmt:yuv420p
    [movie @ 0x210b7c0] seek_point:0 format_name:(null) file_name:water1.png stream_index:0
    [overlay @ 0x2106ec0] auto-inserting filter ‘auto-inserted scaler 0′ between the filter ‘Parsed filter 0 movie’ and the filter ‘Parsed filter 1 overlay’
    [scale @ 0x2106fe0] w:708 h:396 fmt:bgra -> w:708 h:396 fmt:yuva420p flags:0×4
    [overlay @ 0x2106ec0] main w:708 h:396 fmt:yuv420p overlay x:10 y:10 w:708 h:396 fmt:yuva420p
    [overlay @ 0x2106ec0] Overlay area (10,10)(718,406) not within the main area (0,0)(708,396) or zero-sized

    any solution to that ?, and thanks

    1. Chaz Scholton Post author

      It appears your png file has the exact same dimensions as your video file. When positioned 10 pixels from the top and left [overlay=10:10] it pushed the image outside the dimensions of your video.

      The Overlay area (10,10)(718,406) not within the main area (0,0)(708,396).

      (10,10)(718,406) is the x:y position of your image (top left)(bottom right) corners.
      (0,0)(708,396) is the x:y position of your video (top left)(bottom right) corners.

      My suggestion is that you either position it with overlay=0:0 or edit your png file so that has a much smaller width/height to freely position it without going outside the boundary positions of your video.

  22. Keith

    Thanks for putting this up – it is getting me close to what I need. I actually need to do the inverse of this. That is I have a series of png’s with transparency which I want to turn into a video with each of these frames overlaid on a static background opaque png. I easily turn the frame pngs into a video with:

    ffmpeg -i frame.%05d.png -vcodec png

    This video seems to be fine, though Quicktime, anyway, plays it over a black background. But when I try to put this over the static background png with for example:

    ffmpeg -i -vcodec png -vf “movie=bg.png [bg]; [bg][in] overlay=0:0 [out]”
    It works well but only makes one frame – the first frame of the transparent properly overlaid on the background in bg.png. I guess it takes the duration, frame rate, etc. from the lowest layer (the single frame background in this case)? I had hoped that by putting ‘-i’ first it would take that as the main movie and use its duration, frame rate, etc. But it does not seem to. Is there some other way to force it to do so? Or some other way of accomplishing what I’m trying to do?

    Thanks for any help, Keith

    1. Keith

      So I was able to use:

      ffmpeg -loop 1 -i bg.png -vcodec png -t 40

      to duplicate the static bg image into a video of the same length as the transparent video. After that, overlaying with:

      ffmpeg -i -vcodec png -vf “ [bg]; [bg][in] overlay=0:0 [out]”

      worked fine. This seems inefficient, so I would still love to hear better suggestions.

      Thanks, Keith

      1. Chaz Scholton Post author

        The frame length of the source movie along with it’s dimensions establish the initial boundaries when working with FFmpeg.
        You are going about it the right by generating a movie from a single still frame image to use as the source file (background in this case).

        It’s always interesting to see people pushing the use of something outside of typical use cases. The more people which desire to use FFmpeg in the manner you will eventually lead to further enhancements and added features. However, this is conditional upon the demand for such features. FFmpeg is a work in progress. You could always make a suggestion for a feature request to the people at FFmpeg.

    2. Chaz Scholton Post author

      Keith, have you tried something along the lines of

      ffmpeg -i bg.png -vf “[animation]; [in][animation] overlay=0:0 [out]” -sameq

      where you overlay the animation you’ve generated on top of the bg.png? I’ve not experimented around with actually do this (at least yet)

      You might want to work with turning your bg.png into a multiframe video mov file. Your png file which you are using for a static background contains one frame after all, so this may be the reason why it’s only processing and rending at 1 frame and stopping.

      I’ve not tested nor experimented around with what you’re trying to do, just tossing out some ideas for you to try out.

  23. Matt

    Is there a way to overwrite the existing file with the watermark?

    Seems doing so just replaces the video with the watermark file and makes it a video file.

    1. Chaz Scholton Post author

      My suggestion is to overwrite the existing file with new video file after it’s been fully generated. I often use a sub directory folder to temporarily store files being processed. You may consider keeping copies of original non-watermarked videos in a separate folder should you ever need to replace the watermark.

  24. seshu


    i follow the steps you mention to include watermark in video file during ffmpeg conversion but when i include -vf “movie=logo.png [watermark]; [in][watermark] overlay=10:10 [out]“, it stops my conversion process also. My ffmpeg version is 0.6.5, please help regarding these.


  25. seshu

    [movie @ 0x2e33ac0] init() expected 3 arguments:’logo.png’
    Error initializing filter ‘movie’ with args ‘logo.png’

    after updating ffmpeg, i get above error, please help to solve the error.


  26. Rob

    Hi, I am looking to have a scrolling test watermark for every video uploaded by my members. Can you please explain how to do this?


    1. Chaz Scholton Post author

      Hi Rob, take a look at using the Drawtext function. Look at Examples in section 9.20.3. Be certain to get familiar with the Syntax and Parameters listed in section 9.20.1 of the docs here (very important).

      You’ll want to set your x and y positions to work with formula expressions instead of using hard set positions for the scrolling effect.

      One of the examples in section 9.20.3 demonstrates how to show the content of file ‘CREDITS’ off the bottom of the frame and (scroll up).


      You can work with text contained in an external file using the “textfile” parameter or you can work with “text” parameter instead. Again, I encourage you to become familiar with All the Parameters and their Syntax use (as per section 9.20.1).

      If you notice in this example y=h-20*t that the y position is set using the input height (main_h, h, H) minus 20 (offset) multiplied by the timestamp expressed in seconds (t). Note: that the Mathematical order of operations apply when working with expressions.

      It may take a little time and experimentation for you to tweak things. I hope this helps point you in a direction to a possible solution.

      There are other possible ways to approach this solution as well, enough to fill a series of How-to articles.

      Good luck and let me know if this helps you a little more.

  27. Pingback: Adding a watermark to MTS video file using avconv | Ubuntu Info - James n Sheri.comUbuntu Info – James n

  28. Marouane

    hello dear thank you for the tutorial , i use the same code and its works like that :

    -1 ffmpeg -i VIDEO_IN.avi -vcodec libx264 -vpre lossless_slow -crf 25 -acodec copy -threads 0 -s 720x400 -vf "movie=water1.png [watermark]; [in][watermark] overlay=10:10 [out]" VIDEO_OUT.avi

    but when i want to convert with the same quality it dosnt work , i use this code :

    -2 ffmpeg -i VIDEO_IN.avi -vcodec copy -acodec copy -threads 0 -s 720x400 -vf "movie=water1.png [watermark]; [in][watermark] overlay=10:10 [out]" VIDEO_OUT.avi

    i get the same video without watermark , i wish you can help me with , i just want the same quality with a watermark and thank you !!

  29. Pingback: Watermark with ffmpeg | ACMS

  30. Pingback: ffmpegで動画に透かし画像を入れる | よろしく哀愁

  31. gallagherrobby

    Besides working as a powerful Video/Audio Converter and Downloader, iDealshare VideoGo is also a professional Video Watermarker which helps to add watermark to video of any format.

    Key Features:

    Add watermark to AVI, MP4, MOV, WMV, MKV, FLV, VOB, ASF, AVCHD, MTS, MXF, MOD, TOD, 3GP, SWF, MPEG-1, MPEG-2, DV, and etc
    Add text watermark to movies files
    Add image or picture watermark to video like adding JPG, PNG, JPEG, BMP, GIF, TIFF and etc to videos.
    Batch watermark video files as well as keep the same output video format or convert to other video formats.
    Add and edit the font, color, size, position and transparency of the text watermark
    Add and edit the size, placement and transparency of the image watermark
    Download as well as watermark YouTube videos like FLV, WebM, MP4 and etc.

  32. Andrealove

    I encountered the same issue and found this article.
    I don’t have any technical experience, so I’m totally lost.
    Then I turned to Google to look for a tool which can do this for me.
    Finally, I find Bigasoft Total Video Converter. It’s a magic.
    I can’t help sharing it with you!

  33. Pingback: ffmpegで動画に透かし画像を入れる

  34. Pingback: ffmpeg – Videos decodieren, encodieren und konvertieren

  35. Paul

    Great article.
    I have one addition: watermark duration, overlay portion, watermak only fragment of movie, overlay only selected moment.

    ffmpeg -i original_video.mp4 -vcodec h264 -f mp4 -b:v 300k -g 160 -acodec copy -vf "movie=image1.jpg [wm]; [in][wm] overlay=x='if(gte(t,1)*lte(t,20), main_w/2-overlay_w/2, NAN)':y=main_h/2-overlay_h/2 [out]" test01.mp4

    gte(t,1)*lte(t,20) add overlay from second 1 to second 20. Haven’t tested, but I assume all times are in seconds.
    x=main_w/2-overlay_w/2, y=main_h/2-overlay_h/2 place watermark in center of the video. For other positions, see original article.
    video/audio codec, quality – change at will


Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>