How to set pts time format when using ffmpeg filter to add timestamp
Do

In order to draw Timestamp: 01:25., you should specify this one to (feed) ffmpeg:

drawtext = text = 'Timestamp\: %{pts\:gmtime\:0\:%M\\\:%S}.'


Don't

If you specify this one to (feed) ffmpeg:

drawtext = text = '%{pts\:gmtime\:0\:%M\\:%S}'


, it gives Unterminated %{} near '{pts:gmtime:0:%M\' error.

But in bash

But if you're using bash-like shell and a weak quote, "......", to feed it,


\\ is escaped to \, and
\: is not escaped but remains without any changes because \: is not an escape sequence.


So it should be:

-filter_complex "drawtext = text = '%{pts\:gmtime\:0\:%M\\\\\:%S}'"


i.e. bash's "\\\\\:" for ffmpeg's \\\: for getting a single character : displayed.

Note that

If you only want to apply one or more filters to one video stream (e.g, drawtext), you can use -vf instead of using --filter_complex. The latter is reserved for applying filters on multiple streams.