According to the documentation:
hms
stands for a formatted [-]HH:MM:SS.mmm timestamp with millisecond accuracy.
And there's no way to customize this timestamp format. At least not for the hms
format.
The same documentation:
If the format is set to localtime
or gmtime
, a third argument may be supplied: a strftime() format string. By default, YYYY-MM-DD HH:MM:SS format will be used.
So text='%{pts\:gmtime}'
without any additional arguments puts out 1970-01-01 00:00:00
(Unix epoch).
To have it put out 00:00:00
set the 2nd argument to 0
and the 3rd to %H:%M:%S
.
As the pts
function can take up to 3 arguments, make sure you escape the colons twice on Windows and three times on Unix to prevent %M
and %S
from being interpreted as a possible 4th or 5th argument.
Windows:
ffplay -vf "drawtext=text='%{pts\:gmtime\:0\:%H\\\:%M\\\:%S}':x=1:y=1:fontsize=20:fontcolor=white:box=1:boxcolor=black:boxborderw=2" myfile.mp4
Unix:
ffplay -vf "drawtext=text='%{pts\:gmtime\:0\:%H\\\\\:%M\\\\\:%S}':x=1:y=1:fontsize=20:fontcolor=white:box=1:boxcolor=black:boxborderw=2" myfile.mp4
Compared to your initial command I've also added :x=1:y=1
and :boxborderw=2
. It adds a small border around the text and positions the text nicely centered.
It's a matter of taste of course. You can remove it if you don't like it.