To create a burnt in timecode in ffmpeg, two escaping backslashes are required on the command line as so:
00\\:00\\:00\\:00
Using ffprobe to find the starting timecode produces the following output with a subprocess_output
00:00:00:00\n
I am using rstrip()
to remove the new line, but how can I create a new variable that I can pass to ffmpeg's filter chain that will add those escaping backslashes?
I ultimately need my commandline to expand to something like this:
-vf 'drawtext=fontfile=/Library/Fonts/Tuffy.ttf:fontcolor=white:timecode=00\\:00\\:00\\:00:rate=25:boxcolor=0x000000AA:box=1:fontsize=40:x=360-text_w/2:y=405'
though of course in my script, it will just contain
timecode=%s