FFmpeg | Vertical Text Scrolling with loop

Here i am sharing very useful command for vertical text scrolling on video. We can do it in a single command. This is really very nice command to do looping of scrolling text.

Scrolling from bottom to top:

ffmpeg -i input.mp4 -vf drawtext=”fontfile=C\:/Windows/Fonts/arial.ttf:textfile=info.txt : x=(w-tw)/2 : y=((h+th)- mod(4*n,h+th+100)):fontcolor=white:fontsize=30″ output8.mp4

Offset calculation:


y = ((h+th) – mod(4*n,h+th+100)) (calculating x to scroll text from left to right with respect to time and mod with reset value of ‘x’ when text will reach to right wall of screen)x = (w-tw)/2 (#placing text at center of screen)

Note: To increase speed of scrolling we have to increase value of multiplier from (2*n) to (5*n)

If you want to understand in detail, so please watch my video tutorial session on looping of vertical scrolling text.

If you guys have any doubts, so please write in comment box. I will try my best to reply as soon as possible.

Leave a Comment