How to make text run on image? [closed]

I have a photo and a text page. I want to make a video with a background image that I have and the text will run on that photo. Please help me with ffmpeg


Basic method is

ffmpeg -loop 1 -i image \
       -vf drawtext=textfile='yourtextfile':x=X:y=h-t*(h/D),format=yuv420p \
       -t T out.mp4

yourtextfile is a plaintext UTF-8 file.

You will have to see how long the text takes to scroll across and use that in the -t T option (e.g. -t 30 to make a 30 second video), otherwise ffmpeg will keep going indefinitely.

X should be replaced with a value that represents horizontal position. x=100 for 100 pixels from left-edge. x=w-500 for 100 pixels from right-edge.

In the y expression, h/D controls the scrolling speed. D is the number of seconds a line takes to reach from the bottom to the top.

Consult the drawtext documentation for more details, like font selection and styling.