Is it possible to modify the timecode format of ffmpeg?

2

I am trying to overlay my video with the timecode.

Currently, I have this:

ffmpeg -y -i input.avi -vf "drawtext=:fontfile=/Windows/Fonts/myfont.ttf:timecode='00\:00\:00\:00':rate=$framerate: fontcolor=white: x=700: y=555" -crf $quality -vcodec libx264 output.avi

This works but uses the default format of hh:mm:ss:ff.

Is it possible to just display the elapsed time in seconds only?

If not, is there another way of displayed the number of elapsed seconds?

user224579

Posted 2014-11-13T23:06:47.917

Reputation: 131

$framerate and $quality are bash variables. – user224579 – 2014-11-13T23:07:34.480

First of all, good morning. I did not catch your name. Stackoverflow might be a better forum for these type of questions. – Firee – 2014-11-14T10:27:34.837

1@Firee nah, since this is about using a tool rather than programming, SuperUser is the best place for it. – evilsoup – 2014-11-14T12:33:12.837

Thanks for your replies. Yeah..I debated between the two and chose superuser. Is it bad practice to post on both? – user224579 – 2014-11-14T17:56:04.190

Yes. Crossposting is not recommended, and several users probably check both sites anyway. – llogan – 2014-11-14T18:55:12.257

Possible duplicate of Can FFMPEG extract images from a video with timestamps?. Example in answer shows how to add duration timestamp.

– llogan – 2016-02-28T19:24:13.727

Answers

1

is possible with strftime and basetime you can put initial date and time and in text paramter you can set the format of the date and time. ex:

ffmpeg -i inputvideo.mp4 -vf "drawtext=expansion=strftime: basetime=$(date +%s -d'2019-11-22 14:06:01')000000: text='%d/%m/%Y %H\\:%M\\:%S': r=12: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: fontsize=42" outvideo.mp4

rüff0

Posted 2014-11-13T23:06:47.917

Reputation: 113