How do I escape colons and apostrophes in drawtext?
A colon ends an option in a filter, even inside quotes. This fails before any frame is read:
ffmpeg -i in.mp4 -vf "drawtext=fontfile=Inter.ttf:text='Scales: day 1':fontsize=40:fontcolor=white" -c:a copy out.mp4No option name near ' day 1:fontsize=40:fontcolor=white'
Write it as \: and the text draws: text='Scales\: day 1'. The same goes for the colons in %{pts\:hms} and in a timecode.
Apostrophes are worse because they are also the filter's quote mark. With text=She\'s here the apostrophe opened a quote and swallowed the rest of the filter: the frame showed Shes here:fontsize=36:fontcolor=white:box=1:... in small black type in the top-left corner. Other escapes we tried dropped the apostrophe and drew "Shes here".
Put the text in a file instead. textfile=text.txt drew Scales: day 1 and She's not giving up exactly as typed, on two lines, with no escaping at all.




