Scroll Text Vertically Like Movie Credits in FFmpeg

This guide explains how to create a vertical scrolling text effect, similar to movie credits, using the FFmpeg drawtext filter. You will learn the exact command-line syntax, how to control the scrolling speed, and how to position your text so it rolls smoothly from the bottom to the top of your video.

To create a scrolling credits effect, you must dynamically change the vertical coordinate (y) of the text over time. FFmpeg allows you to do this by using the t (time in seconds) variable inside the drawtext filter expression.

Here is the standard command to scroll a text file over a solid black background:

ffmpeg -f lavfi -i color=c=black:s=1920x1080:d=20 -vf "drawtext=fontfile=sans.ttf:textfile=credits.txt:fontsize=48:fontcolor=white:x=(w-tw)/2:y=h-t*150" -c:v libx264 -pix_fmt yuv420p output.mp4

How the Command Works

Adjusting the Scroll Speed

To change how fast the credits scroll, modify the multiplier in the y equation. * Slower scroll: Decrease the number (e.g., y=h-t*100). * Faster scroll: Increase the number (e.g., y=h-t*250).

Overlaying Credits on an Existing Video

If you want to overlay the scrolling credits on top of an existing video instead of a black background, use this command:

ffmpeg -i input.mp4 -vf "drawtext=fontfile=sans.ttf:textfile=credits.txt:fontsize=48:fontcolor=white:x=(w-tw)/2:y=h-t*150" -c:a copy output.mp4

This command applies the filter directly to input.mp4 and copies the audio stream without re-encoding it, saving processing time.