MarcinWad
MarcinWad

Reputation: 118

FFMPEG - scrolling text in area

I try to make scrolling news ticker on a video as overlay. I have created a PNG background with a specified place where where i want to scrolling text appear.

I tried with this:

ffmpeg -i INPUT.mp4 -vf "drawtext=textfile=ticker.txt:fontfile=BebasNeue-Regular.ttf:y=h-line_h-10:x=w-mod(w*t/25\,2400*(w+tw)/w):fontcolor=white:fontsize=40:shadowx=2:shadowy=2" -codec:a copy output.mp4

but this command scrolls text from right margin to left margin.

What i want to achieve is that scrolling text scrolls only in selected boundary box i set (in example starts from 100px from right and ends 100px from left).

I didnt find any answer here or in Google - every example scrools from left to right directly.

Upvotes: 0

Views: 1589

Answers (1)

MarcinWad
MarcinWad

Reputation: 118

I eneded up splitting the job in two parts: 1. Encode a text scroll video with ffmpeg with size of the ticker size (i.e. 700x60px) 2. Overlay this ticker video part on the final video in selected place using overlay filter to merge both.

Hope this helps.

Upvotes: 2

Related Questions