ffmpeg在drawtext中单引号 [英] ffmpeg single quote in drawtext

查看:1467
本文介绍了ffmpeg在drawtext中单引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使我逃避他们,我也无法获取ffmpeg的drawtext视频过滤器来绘制撇号/单引号,当它们在drawtext的text =参数中时。双引号工作正常,从文件加载的文本(例如textfile =example.txt)中的撇号工作正常。这是一个错误吗?



例如

  ffmpeg -i test.mpg -vf drawtext =撇号不打印... 
ffmpeg - i test.mpg -vf drawtext =即使他们没有转义...


  ffmpeg -i test.mpg -vf drawtext = text =It\\\\\很容易

生成包含撇号的文本叠加层。文本被解析了几次,所以你不仅要逃避报价,还要逃避斜线逃避报价。



在这种情况下,您使用文本文件的替代方法可能是更好的方法。


I haven't been able to get ffmpeg's drawtext video filter to draw apostrophes/single quotes when they are in drawtext's "text=" parameter, even when I escape them. Double quotes work fine, and apostrophes in text loaded from a file (e.g. textfile="example.txt") work fine. Is this a bug?

e.g.

ffmpeg -i test.mpg -vf drawtext="apostrophes don't print" ...
ffmpeg -i test.mpg -vf drawtext="even when they\'re escaped" ...

解决方案

Special character escapes are like violence: if they're not solving your problem, you're not using enough.

ffmpeg -i test.mpg -vf drawtext=text="It\\\\\'s so easy"

Produces a textual overlay that includes an apostrophe. The text is being parsed a couple times, so you not only have to escape the quote, you also have to escape the slash escaping the quote. Twice.

Your alternative of using a textfile might be a better method in this situation.

这篇关于ffmpeg在drawtext中单引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆