douxian9943 2017-04-24 22:04
浏览 233
已采纳

从php shell_exec运行ffmpeg时如何添加空格

I am trying to insert text overlay, and can do this, but I cannot add spaces to the text.

ffmpeg -i meme.mp4 -y -vf drawtext='/Users/me/Library/Fonts/Champagne & Limousines.ttf:text='testtext': fontcolor=white: fontsize=24' -codec:a copy outputtexttest.mp4 2>&1

The error when I make testtext test text is:

Unable to find a suitable output format for 'text: fontcolor=white: fontsize=24' text: fontcolor=white: fontsize=24: Invalid argument

  • 写回答

1条回答 默认 最新

  • dpz1983 2017-04-24 22:11
    关注

    Add double quotes around the text, not single quotes like you have:

    echo shell_exec("$ffmpeg -i meme.mp4 -y -vf drawtext='/Users/me/Library/Fonts/Champagne & Limousines.ttf:text=''test    + infinity spaces :)   text'': fontcolor=white: fontsize=24' -codec:a copy outputtexttest.mp4 2>&1");
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?