Scroll Text from Bottom to Top in Ffmpeg

I want to scroll text from bottom to top.  I use the command:

ffmpeg -i test.mp4 -vf "drawtext=fontfile=tahoma.ttf:fontsize=40:fontcolor=green:x=(w-text_w)/2+20:y=h-40*t:text=Scroll.txt:bordercolor=white:borderw=2" -c:v libx264 -y -preset ultrafast scrolling.mp4

It scrolls from bottom to top, but I want to scroll from bottom to (top - 50px) only. (I get text from a file and multilines).

1 Answer

Quickest way to do this is to overlay the top 50 px of the original video onto the video with text.

Use

ffmpeg -i test.mp4 -filter_complex "[0]split[txt][orig];[txt]drawtext=fontfile=tahoma.ttf:fontsize=40:fontcolor=green:x=(w-text_w)/2+20:y=h-40*t:text=Scroll.txt:bordercolor=white:borderw=2[txt];[orig]crop=iw:50:0:0[orig];[txt][orig]overlay" -c:v libx264 -y -preset ultrafast scrolling.mp4
7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest