Using ffmpeg, I would like to overlay the current local timestamp with milliseconds onto a video using ffmpeg in a YYYY-MM-DD HH:MM:SS.mmm
format. I've seen a similar question asked, but did not see an answer to displaying millisecond portion.
Using text=%{localtime}
simply displays YYYY-MM-DD HH:MM:SS
without milliseconds. If you try to use common millisecond specifiers to display the milliseconds portion it does not work as in text=%{localtime\\:%Y %m %d %H %M %S %s}
or text=%{localtime\\:%Y %m %d %H %M %S %f}
.
If you use text=%{pts\\:hms}
it does display milliseconds, but it's not referenced to current local time. You could add an offset in total seconds since midnight to bring you get you close to the local time as in text=%{pts\\:hms\\:61200}
to get you to 5pm, but that is a snapshot of when the command was called, not the actual current local time the video frame was captured in milliseconds.
UPDATE:
I just found this article: https://github.com/InSoundz/ffmpeg-strftime-milliseconds
It looks like someone had added millisecond resolution to the strftime()
function that ffmpeg uses.
My only issue is I do not know how to re-build the Windows release *.exe using this source code. Can anyone assist with this? Once that is re-built into a Windows executable, then I should be able to add millisecond resolution using a %u
formatter as in: %Y-%m-%d_%H-%M-%S.%%03u
to get the example of 2017-05-28_12-26-33.599
timestamp added to the recorded video. Could anyone please assist me with this Windows *.exe re-build using this modified library?
Any help on this would be greatly appreciated!