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
A drained and empty Kennington reservoir images from a drone in early July 2024. The…
Merrimu Reservoir from drone. Click images to view larger.
Some early September spring shots from a bushwalk, It is still too early for wildflowers.
I recently needed to clone over a smaller NVMe to a 2TB SK Hynix Platinum…
If you ever needed a simple solution in Laravel to delete an entire directory and…
How to enforce only one user to register or be registered in a Laravel web…