Show text between 5-10 seconds: ffmpeg -i input.mp4 -vf "drawtext=fontfile=/path/to/font.ttf:text="Stack Overflow":fontcolor=white:fontsize=24:box=1: :boxborderw=5:x=(w-text_w)/2:y=(h-text_h)/2:enable="between(t,5,10)"" -codec:a copy output.mp4 Use the enable option to control when the text appears.
You can reposition the text with the sendcmd and zmq filters: You can chain multiple drawtext filters: ffmpeg -i input.mp4 -vf "drawtext=fontfile=/path/to/font.ttf:text="Stack Overflow":fontcolor=white:fontsize=24:box=1: :boxborderw=5:x=(w-text_w)/2:y=(h-text_h)/2,drawtext=fontfile=/path/to/font.ttf:text="Bottom right text":fontcolor=black:fontsize=14:x=w-tw-10:y=h-th-10" -codec:a copy output.mp4 You can use ffplay to preview your text without having to wait for a file to encode: ffplay -vf "drawtext=fontfile=/path/to/font.ttf:text="Stack Overflow":fontcolor=white:fontsize=24:box=1: :boxborderw=5:x=(w-text_w)/2:y=(h-text_h)/2" input.mp4Īlternatively you can use mpv but the syntax is slightly different: mpv -vf="lavfi=:boxborderw=5:x=(w-text_w)/2:y=(h-text_h)/2]" input.mp4