Watermarking a video with the current frame number using FFmpeg. This method involves using the video filter option with the frame_num.
For this, I had Arial.ttf sitting in the root folder alongside FFmpeg and the fontfile path simply states this.
The FFmpeg command is:
ffmpeg -i input.mp4 -vf "drawtext=fontfile=Arial.ttf:text='%{frame_num}':start_number=1:x=(w-tw)/2:y=h-(2*lh):fontcolor=white:fontsize=50:" -c:a copy output.mp4 This will start at frame number 1 and overlay the frame number onto the video at position x=(w-tw)/2:y=h-(2*lh) which is centred left to right and about an eighth up from the bottom of the screen.
The video and audio settings are copied, there is no compressing.
Remember to ensure that the font file exists at the path.
This command depending on the length of your video could take some time as it cannot be executed with a re-encode.
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…