Media Created - bulk update (shift date by 30 days backwards)

Tore Teigene
Tore Teigene used Ask the Experts™
on
I have a couple of hundred GoPro clips where the Media Created date is wrong.
It is set a month too late (is September, should be August) so i want to shift 31 days.
This seems not to be straight forward.
Looking at tool called bulkrename, totalcommander and also Adobe Premiere and  GoPro Quik but none of these can amend this attribute on the file (and not as a bulk job.)

Anyone knows about a full featured file utility that can do such things. Does not have to be free.... just do the job "

/thanks for any suggestions
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Super easy using ffmpeg. Something like this...

ffmpeg -y -i clip.mp4 -c:a copy -c:v copy -map_metadata -1 -metadata creation_time=2016-09-20T21:30:00 new-clip.mp4

Open in new window


The trick here is you must rewrite the .mp4 container metadata, which requires a pseudo-transcode.

I say pseudo, because passing copy as the codec, causes the stream to be copied with no transcode, so this operation takes a maybe a few seconds for every 10G of footage to pseudo-transcode.

The metadata syntax will vary slightly between ffmpeg versions, so refer to ffmpeg -help for your version's exact syntax.
Tore TeigeneContractor

Author

Commented:
Thanks David
That was an idea but I can't see anything in the documentation to indicate how to shift the date (not time) by e.g. 30 days.
From your suggestion i need to create a script which first reads the creation_time, then do some calculation to get to the right date and then write it back to the mp4-file.
I was hoping for a "simpler" solution as there are tools handling "normal" date/timestamp shifting, but none for metadata like "Media created"
David FavorFractional CTO
Distinguished Expert 2018

Commented:
You asked, "That was an idea but I can't see anything in the documentation to indicate how to shift the date (not time) by e.g. 30 days".

With ffmpeg you just set any date you'd like.

So if you'd like to increase the date by 30 days, then you'd...

1) Retrieve the current date.

2) Date might be in a meta field or might be the file timestamp. Likely best to fallback to timestamp, as many videos have no embedded timestamp.

3) Then add 30 days to the retrieved date. I'd just use PERL for this, as coding PERL for me is trivial. Any scripting language will do.

4) Write the new date into a meta field, using ffmpeg.

There's no GUI tool which allows you to somehow choose the meta date field + say add 30 days + rewrite the field.

Because... this logic is

1) Overly complex for a GUI tool (you'd have to write a meta field selector + then an entire math engine, like the calc program to do your math)

2) Using ffmpeg makes this a trivial command line exercise.

If I had to do this for one video, I'd just do manual math + execute a single command.

If I had to do this for 1000s of videos, I'd write a script to do the work.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial