2017-04-24 22:04
浏览 172

从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

图片转代码服务由CSDN问答提供 功能建议


  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 

错误 当我制作testtext测试文本时:

无法为'text:fontcolor = white:fontsize = 24'文本找到合适的输出格式:fontcolor = white:fontsize = 24:参数无效

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

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");
    解决 无用
    打赏 举报