Here’s how to watermark your video with ffmpeg by adding text

Merunas Grincalaitis
2 min readDec 10, 2022

Recently I had to watermark a few videos and instead of using a program to edit all of the videos manually, I decided to use ffmpeg which is far faster and more effective when you want the same result over and over.

Here’s how the command looks, then I’ll explain in it in detail:

ffmpeg -i my-video.mp4 -y -vf "drawtext=text='my watermark':x=100:y=400:fontfile=./fonts/Poppins/Poppins-Black.ttf:fontsize=100:fontcolor=white@0.2" watermarked.mp4

Here’s the breakdown:

  • -i my-video.mp4 simply the input video.
  • -y means we want to override any existing videos with the same output name.
  • -vf here is where we add the watermark with this filter option. Each parameter is separated by a colon : so you can specify multiple filter options.
  • drawtext=text='my watermark' this is the text we want to display as the watermak.
  • x=100 means the watermark will be pushed 100 pixels from the left.
  • y=400 means the watermark will be pushed 400 pixels from the top.
  • fontfile=./fonts/Poppins/Poppins-black.ttf this is a font I’ve downloaded from google fonts and it’s called poppins. You need to add that font to the same folder and write down the exact font you want to use. This is optional, you can skip this parameter for the default font.
  • fontsize=100 that’s the font size. It will be 100 pixels tall. You can try a bunch of values and see what works for you.
  • fontcolor=white@0.2 this means the font will be white AND it will have an opacity of 0.2. The opacity can be from 1 (fully visible) to 0 (fully transparent).
  • watermarked.mp4 that’s the output file name.

Now if you want to add multiple watermark texts, you have to make some changes and use -filter_complex instead of -vf like the in following example:

ffmpeg -i my-input-video.mp4 -y -filter_complex "[0]drawtext=text='first watermark':x=200:y=400:fontsize=100:fontcolor=white@0.4[one];[one]drawtext=text='second watermark':x=200:y=800:fontsize=100:fontcolor=white@0.4" watermarked.mp4
Merunas Grincalaitis

Blockchain expert. Join my email list here to receive new articles every few months

Recommended from Medium