[FFmpeg-user] How to properly escape a literal comma ", " in drawtext filter text?

Steven Kan steven at kan.org
Wed Dec 30 00:58:26 EET 2020

> On Dec 28, 2020, at 9:55 PM, Steven Kan <steven at kan.org> wrote:
>> On Dec 28, 2020, at 9:33 PM, Carl Zwanzig <cpz at tuunq.com> wrote:
>> On 12/28/2020 5:44 PM, Carl Zwanzig wrote:
>>> (If I have a chance later tonight, I might look into the filter's source code.)
>> I took an admittedly quick look at vf_drawtext.c and the helper routines. It looks like the only string quoting needed would be for '\' and '%', so not for a comma. I did not dive further into character processing. It does look like there's a substitution made for characters that can't be found in the font so it could be that the font is faulty or that the comma isn't really a comma (see prev. email).
> Hi Carl,
> Thanks for the research. I think the culprit is the font 🤦‍♂️ (If that last glyph doesn’t render properly in the mailing list, it’s a facepalm)
> I switched from Keyboard.ttf to Helvetica.ttc, and now the commas render properly. 
> So sorry to everyone for the colossal waste of time and bandwidth. I’ll post the final results of my experiment tomorrow as atonement.

So here’s what happens once I use the correct font:

https://www.youtube.com/watch?v=IpKW5Gzrayc <https://www.youtube.com/watch?v=IpKW5Gzrayc>

Also, while I was typing out the new text for the drawtext filter, I used a naked colon and received the following error:

Error initializing filter 'drawtext' with args 'fontfile=/System/Library/Fonts/Helvetica.ttc: text=1:2:2, Room Temp Water, No Heat Mat: fontcolor=white: fontsize=24: box=1: boxcolor=black at 0.5: boxborderw=5: x=w*0.02: y=h*0.02’

So in the future I’ll know if my errors are the results of unescaped characters or some other issue.

More information about the ffmpeg-user mailing list