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

pdr0 pdr0 at shaw.ca
Sun Dec 27 22:34:40 EET 2020


Not sure about other OS's - For Windows, you don't need to escape commas
inside the text field;  but the paths for fonts needs to be escaped

These work ok in windows

one comma
ffmpeg -f lavfi -r 24 -i color=c=green:s=640x480 -vf
drawtext="fontfile='C\:\\Windows\\Fonts\\Arial.ttf':text='Room Temp Water,
No Heat Mat':fontcolor=white:fontsize=24:
box=1:boxcolor=black at 0.5:boxborderw=5:x=(w-text_w)*0.05:y=(h-text_h)*0.05"
-crf 20 -an -frames:v 120 test1.mp4 -y

five commas
ffmpeg -f lavfi -r 24 -i color=c=green:s=640x480 -vf
drawtext="fontfile='C\:\\Windows\\Fonts\\Arial.ttf':text='Room Temp Water, ,
, , , No Heat Mat':fontcolor=white:fontsize=24:
box=1:boxcolor=black at 0.5:boxborderw=5:x=(w-text_w)*0.05:y=(h-text_h)*0.05"
-crf 20 -an -frames:v 120 test2.mp4 -y



--
Sent from: http://www.ffmpeg-archive.org/


More information about the ffmpeg-user mailing list