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.
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…