douxian9943
douxian9943
2017-04-24 22:04

从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 dpz1983 4年前

    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");
    
    点赞 评论 复制链接分享