How to change Media Created Date in Exiftool?
Asked Answered
O

2

9

I have some MP4 videos that don't have Media Created date and time because they were recorded with Instagram camera. I want to set the date and time and I found out that I can do that with Exiftool software. I know that the software works by typing command lines, but I don't know where I should type what. I searched on Google and didn't find any helpful results.

I downloaded the software and got "exiftool(-k).exe" file. What should I do now? I have no idea how it works. I hope somebody can write simple steps just to set that Media Created date.

MP4 file with Media Created property

MP4 file without Media Created property

Outbid answered 25/12, 2018 at 22:46 Comment(2)
you'd be better off asking this on somwhere like superuser.com rather than hereMcalpin
@Keith Nicholas I didn't knowAdemption
B
22

First you will probably want to rename the exiftool(-k).exe to just exiftool.exe and place it someplace in your PATH (see install exiftool-Windows). There is also Oliver Betz's Alternative Exiftool build for Windows which includes an installer and is a bit more security friendly. See this post on the exiftool forums. For those that use Chocolatey, the Chocolatey exiftool package will add exiftool to the PATH and is a well maintained package

Then you will want to use one of these commands. In the case of your example filename, the filename appears to have been named for the time it was taken i.e YearMonthDay_HourMinutesSeconds. In that case you can simply use this command (see exiftool FAQ #5)
exiftool -api QuickTimeUTC "-CreateDate<Filename" 20181223_000542.mp4

This will work correctly as long as the video was taken in the same time zone as the computer you are currently using. If not, you will have to add the time zone like this:
exiftool -api QuickTimeUTC "-CreateDate<${Filename}-04:00" 20181223_000542.mp4

This is because the CreateDate tag for MP4 files is supposed to be UTC and Windows properties will read it as such. Mac Finder will also correctly adjust from UTC. With the -api QuickTimeUTC option, exiftool will automatically adjust the time to UTC.

If you need to set the time to something different than what the filename is, then you would use this, adding the time zone if needed:
exiftool "-CreateDate=2018:12:23 00:05:42" 20181223_000542.mp4

These commands creates backup files. Add -overwrite_original option to suppress the creation of backup files. If on a Mac, the slower -overwrite_original_in_place option could be used to preserve any MDItem/XAttr data Add the -r (-recurse) option to recurse into subdirectories. If this command is run under Unix/Mac/Powershell, reverse any double/single quotes to avoid shell variable interpretation.

You can process as many files and/or directories as you can put on the command line, so if you wanted to process all the files in c:\Dir1 and C:\Dir2, you would just list both of them at the end of the command c:\Dir1 C:\Dir2

Bonzer answered 26/12, 2018 at 0:16 Comment(4)
Thanks for your answer. I did what you said, placed exiftool.exe in my C:\WINDOWS directory. Then, I ran Command Prompt (as administrator) and typed the following: exiftool "-CreateDate=2018:12:23 00:05:42" C:\Users\Katarina\Desktop\20181223_000542.mp4 However, I got the time of 01:05:42 instead of 00:05:42, so I realized I have to add the time zone: exiftool "-CreateDate=2018:12:23 00:05:42-04:00" C:\Users\Katarina\Desktop\20181223_000542.mp4 But I still get the same result! I also tried +/-01:00 etc., and it doesn't work. The time zone for my country is +1 from UTC.Ademption
Sorry, I messed up on the command. I'll rewrite the answer when I get a chance. Try writing exiftool "-CreateDate<${Filename}+01:00" -api "QuickTimeUTC" for files that are named after the datetime or exiftool "-CreateDate=2018:12:23 00:05:42+01:00" -api "QuickTimeUTC" to set a specific time. The time zone should be the correct one for where the video in question shot. Windows will adjust the the date it shows based upon the time zone of the computer reading it, so computers in different time zones will show different times.Bonzer
Great! It works now! Thank you so much! I have one more question, just to understand the code for future purposes. What does api mean and what QuickTime has to do with all of this? Thank you! :DAdemption
The quicktime format is how metadata in Mov/MP4 video is stored. Quoting the exiftool docs "According to the QuickTime specification date/time values should be UTC, but many digital cameras store local time instead (presumably because they don't know the time zone), so the default is to not convert these times. Because of this, exiftool will normally treat video timestamps as local time." But the -api option allows for changes in the default behavior of exiftool. In this case, it tells exiftool "to assume that QuickTime date/time values are stored as UTC, causing conversion to local time"Bonzer
H
0

I found a solution that worked great for me. I copied a lot of old tapes a few years ago, and named them like this: "1992-12-25 Christmas day.mp4" and so on.

When I tried to upload them to Google Photo, they were all sorted by the date I recorded them, so 2020-something. I found a few programs that said it would help me solve the problem, but none of them worked as intended (File Date Corrector and BulkFileChanger). Finally I found a working solution using exiftool.

1: Download exiftool(-k).exe and rename the file to exiftool.exe (remove the (-k)) 2: Place the exiftool.exe file in your C:\ folder (to make it easy to run) 3: Run the cmd command as administrator. Write "cmd" in your start-menu, right click it and press run as administrator. 4: Make sure your in the right folder in cmd, where you placed the exiftool.exe file (write " cd C:\ " and press enter) 5: Write this syntax to edit the .mp4 files: exiftool -api QuickTimeUTC "-CreateDate<Filename" C:\1990 -overwrite_original

This will take the date from the filename and apply it to the Media Created tab that Google Photo uses. Make sure to do a backup of your files before trying this, in case something goes wrong. Hope this works for all of you :)

Hydrothorax answered 21/1, 2024 at 13:29 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.