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.
Using FTP and PHP to get an array of file details such as size and…
Creating and using Laravel form requests to create cleaner code, separation and reusability for your…
Improving the default Laravel login and register views in such a simple manner but making…
Laravel validation for checking if a field value exists in the database. The validation rule…