6

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

Katarina Perović
  • 361
  • 1
  • 5
  • 22

1 Answers1

19

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

StarGeek
  • 4,948
  • 2
  • 19
  • 30
  • 1
    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. – Katarina Perović Dec 27 '18 at 00:20
  • 1
    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. – StarGeek Dec 27 '18 at 01:17
  • 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! :D – Katarina Perović Dec 28 '18 at 00:20
  • 1
    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" – StarGeek Dec 28 '18 at 06:07