3

I'm adding text to an animated GIF.

I would like the text to appear at a specific time, though, and I'm unable to do that.

This is what I have:

ffmpeg -i image.gif -vf 'drawtext=textfile=/path/to/text.txt:x=0:y=0:fontfile=/path/to/font.ttf:fontsize=64:fontcolor=white:borderw=3:bordercolor=black:box=0'

I tried different approaches, but nothing seems to work. I can manipulate timing for the video using things like -itsoffset 00:00:30, but not the text.

nkkollaw
  • 1,947
  • 1
  • 19
  • 29

1 Answers1

9

You have to use timeline editing.

-vf 'drawtext=textfile=/path/to/text.txt:x=0:y=0:fontfile=/path/to/font.ttf:fontsize=64:fontcolor=white:borderw=3:bordercolor=black:box=0:enable='between(t,23,31)''
Gyan
  • 85,394
  • 9
  • 169
  • 201
  • Ha! I tried that, but your suggestion made me look at the code again, and my problem had to do with escaping commas. Thanks for your help. – nkkollaw Apr 17 '17 at 10:16
  • 1
    Correct. And here's the link to the documentation with exemples [Timeline editing](http://ffmpeg.org/ffmpeg-filters.html#Timeline-editing) – tuk0z Jun 18 '17 at 21:36