ffmpeg single quote in drawtext

前端 未结 6 1026
粉色の甜心
粉色の甜心 2020-12-09 19:32

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. Doub

6条回答
  •  忘掉有多难
    2020-12-09 20:23

    In case someone needs this for python, this escape function is working for me (based on https://ffmpeg.org/ffmpeg-utils.html#Quoting-and-escaping + multi-escaping advice above):

    return "'" + text.replace(":", "\\:").replace("'", "'\\\\\\''") + "'"

提交回复
热议问题