Fmpeg | Horizontal text scrolling with looping

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

Scrolling from left to right: (at Bottom)

ffmpeg -i input.mp4 -vf drawtext=”fontfile=C\:/Windows/Fonts/arial.ttf:text=’This is Cool IT Help’ : y=h-line_h-10:x=(mod(5*n,w+tw)-tw):fontcolor=white:fontsize=30″ output1.mp4
Offset calculation:

y = h-line_h-10 (#placing text at bottom of screen)

x = (mod(5*n,w+tw)-tw) (calculating ‘x value’ to scroll text from left to right with respect to time ; ‘mod’ will reset value of ‘x’ when text will reach to right wall of screen)

If you want to learn in detail, please watch my video tutorial session on horizontal scrolling text with looping.

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

Leave a Comment