Categories: CreativeDevelopment

How to do a text watermark in FFmpeg

I wanted a way to avoid using an image to watermark videos with FFmpeg. Sometimes just simple text is great in watermarking media. Here is how to do it with some examples:

Using FFmpeg Drawtext we can create text and add a shadow in the chosen location. This example the watermark will be in the bottom left:

ffmpeg -i "input.mp4" -vf "drawtext=text='a watermark':x=10:y=H-th-10:fontfile=/pathto/font.ttf:fontsize=10:fontcolor=white:shadowcolor=black:shadowx=2:shadowy=2" "output.mp4"

The watermark will also have a shadow that makes the watermark standout more. Keep in mind you must have a font file (.ttf) to do this. Make sure you edit the path to it in the command supplied above.

As for the location of the watermark, that is defined by x and y. In the example the text will be padded 10 from the left and up 10 from the bottom of the video. To do bottom right make it: x=-10:y=H-th-10

 

Share

Recent Posts

Kennington reservoir drained drone images

A drained and empty Kennington reservoir images from a drone in early July 2024. The…

2 years ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

2 years ago

Early September spring shots

Some early September spring shots from a bushwalk, It is still too early for wildflowers.

3 years ago

Cloning an NVMe to SK Hynix Platinum P41 NVMe

I recently needed to clone over a smaller NVMe to a 2TB SK Hynix Platinum…

3 years ago

Using Laravel’s deleteDirectory to delete folders and their contents

If you ever needed a simple solution in Laravel to delete an entire directory and…

3 years ago

How to allow only 1 user to register in a Laravel application

How to enforce only one user to register or be registered in a Laravel web…

3 years ago