Search code examples
ffmpegdrawtext

ffmpeg drawtext leading space characters in text are getting ignored


I am using the below arguments for drawtext in ffmpeg

ffmpeg -i input.gif -vf drawtext="fontfile='ariblk.ttf':text='    Hello World':x=10:y=10:fontsize=30:fontcolor=white" output.gif

notice the spaces before the text specified in argument, but in output the spaces before the text are getting ignored. So how could I stop ffmpeg from doing that.


Solution

  • Escape the first space character.

    text='\    Hello World'
    

    (tested on Win7)