1

I'm trying to get a text written onto a video. I can get it to work when I do it in a single line but not when I need to quote the drawtext inside the double quotes to write two lines.

ffmpeg.exe -i input.ts -vf "[in]drawtext=fontfile=Bebas-Regular.ttf:text='"Day: Sunday"':fontcolor=white:y=(h-h*0.2):x=(w-w*0.95):fontsize=36, drawtext=fontfile=Bebas-Regular.ttf:text='"thing1, thing2, thing3"':fontcolor=white:y=(h-h*0.1):x=(w-w*0.95):fontsize=36[out]" -codec:a copy output1.mp4

I've tried so many combinations of \ but I can't get it to work. The error I get is the following:

Unable to find a suitable output format for 'Sunday':fontcolor=white:y=(h-h*0.2):x=(w-w*0.95):fontsize=36, drawtext=fontfile=Bebas-Regular.ttf:text='thing1,'
Sunday':fontcolor=white:y=(h-h*0.2):x=(w-w*0.95):fontsize=36, drawtext=fontfile=Bebas-Regular.ttf:text='thing1,: Invalid argument

I need the video to have this:

Day: Sunday
Thing1, Thing2, Thing3
DnerD.Dev
  • 13
  • 2

1 Answers1

0

This form with single quotes embedded in a double-quoted string work for me:

-vf "[in]drawtext=fontfile=Font.ttf:text='thing1, thing2, thing3'"

For how to display an apostrophe or single quote, see https://stackoverflow.com/a/10729560/13223986

See also the drawtext documentation.

Pascal Getreuer
  • 2,906
  • 1
  • 5
  • 14