[FFmpeg-user] how to use drawtext?

Frank Tetzel s1445051 at mail.zih.tu-dresden.de
Thu Oct 31 12:11:37 CET 2013


Am Wed, 30 Oct 2013 18:36:34 -0600
schrieb Richard Duran <ricdur2 at gmail.com>:

> Of course, this puts me at square "2". The text is right in the
> middle of my videos. I want to draw text in it's own space above and
> below the videos. I imagine I'll need to adjust my pad values.

The following filter complex is more or less what you want. This
assumes both input videos have the same dimension. Just play with the
parameters and read the documentation and you should be good to go.

-filter_complex "[0:v] setpts=PTS-STARTPTS, pad=iw*2+10:ih+24:0:12 [v1]; [1:v] setpts=PTS-STARTPTS [v2]; [v1][v2] overlay=w+10:12, drawtext=fontcolor=white:text=Header:x=(w-text_w)/2:y=0, drawtext=fontcolor=white:text='First Panel':x=(((w-10)/2)-text_w)/2:y=h-12, drawtext=fontcolor=white:text='Second Panel':x=((((w-10)/2)-text_w)/2)+((w+10)/2):y=h-12"

This is all one line. There's a 10 pixel gap between the videos and 12
pixels above and below for the text.


More information about the ffmpeg-user mailing list