'ffmpeg drawtext to overlay text repeatedly over the whole video space
I want a specific text like Hello world to be spread across multiple rows and over the whole video space/page like this.

I'm running ffmpeg commands in the python script using bash as a subprocess. Sample code:
subprocess.run( [ "ffmpeg", "-i", input_file, "-vf", f"drawtext=font={font_family}:text={watermark_text}:fontcolor={font_color}:fontsize={font_size}{background_box}:{watermark_position}", "-codec:a", "copy", "-preset", encoding_preset, f"./watermark/{media_id}.mp4", ] )
Is there any good way to achieve this?
Solution 1:[1]
This is your basic template. I assume the input is 720p.
ffmpeg -i 720p_input -f lavfi -i "color=black@0:s=64x64,format=yuva420p" -filter_complex "[1]trim=end_frame=1,drawtext=font={font_family}:text={watermark_text}:fontcolor={font_color}:fontsize={font_size}{background_box}:{watermark_position},rotate=a={degree}*PI/180:ow=hypot(iw,ih):oh=ow:c=black@0,loop=-1:1:0,tile=15x9,trim=end_frame=1[wm];[0][wm]overlay=0:0" -c:a copy -preset encoding_preset ./watermark/{media_id}.mp4
{degree} should be replaced by rotation angle.
The ultimate size of each text cell is 64 x sqrt(2) = 90 pixels on each side.
15x9 is the tiling layout. Adjust this to cover the full input frame.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gyan |
