1

I've searched the web thin trying to find some clever way of adding a dynamic date and timestamp on my videos. All I can find are ways to add the current time - not the time of the video.

The Melt Framework almost offers a way to do it. It lets me add dynamictext #timecode# which adds the time starting from 00:00:00:00. If only I could add an offset to this, it would be solved. It also lets me add dynamictext #localfiledate# but this is a static value that doesn't change as the minutes go by, meaning a 10 minute long video will say that all 10 minutes were recorded at the same minute.

As a tedious temporarily (I hope) solution, I'm converting my videos to images, and then scripting my way out of adding a date and timestamp to each image before reassembling to a video again. This works, but takes forever.

I know I can do this if I use Windows and editors like Sony Vegas or Adobe Premiere. I do not use Windows and do not have these editors. Surely there must be a way to do it using a command-line tool in Linux?

mr_lou
  • 193
  • 1
  • 1
  • 11
  • 1
    See http://stackoverflow.com/q/38747518/5726027 – Gyan May 01 '17 at 13:38
  • Thanks. Did not find that one in my searches. However, trying the command in the accepted answer, I'm just getting "Invalid format 'gmtime'" – mr_lou May 01 '17 at 14:08
  • Works here. Your ffmpeg build looks to be older than 2013. Or it could be an issue of escaping? The command works as-is on Win7. – Gyan May 01 '17 at 14:17
  • ffmpeg version 2.8.11-0ubuntu0.16.04.1 – mr_lou May 01 '17 at 14:19
  • Show the full console output – Gyan May 01 '17 at 14:31
  • Alright. Got it working with v3.3, although sadly not quite there. I need to be able to format the date. Basically just show the date differently, and leave out seconds. There's something in the docs about strftime, but various different ways of writing it isn't getting me anywhere. – mr_lou May 01 '17 at 19:35
  • On Win7, this works for me: `text='Time\: %{pts\:gmtime\:1456007118\:%Y-%m-%d %H\\\:%M}'` – Gyan May 01 '17 at 20:48
  • My problem is the escaping of the colon. I tried it like you've written there, but get this error back: Unterminated %{} near '{pts:localtime:1492436469:%d/%m %Y %H\' If I don't use a colon, everything works fine. – mr_lou May 02 '17 at 04:27
  • Solved using %R instead of %H:%M :-) Thanks a lot for your help Mulvya. Something that worries me a bit though, is that the docs says the strftime thingy is deprecated. Do you know if this formatting option suddenly disappears in a future version? – mr_lou May 02 '17 at 04:51
  • 1
    Weird. %R doesn't work here. `strftime` expansion mode is deprecated. Not the use of strftime formatting with the `pts` function. – Gyan May 02 '17 at 05:18

0 Answers0