ExifTool Forum

ExifTool => Newbies => Topic started by: DaveS on September 30, 2022, 12:38:49 PM

Title: Change Creation Date of MP4 based on File Name (MacOS)
Post by: DaveS on September 30, 2022, 12:38:49 PM
Hi All

Been using the app version of ExifTool for years for photos and renaming files based on exif data. However I'm now trying to restore some old videos I took of my kids that apple seems to have deleted from my photos library (lost all videos prior to 2014). Luckily I have a backup of these, but the creation date has been set to todays date.

The file name luckily has the original date / time they were taken.

If I manually import into photos I can amend the date taken, however that will take forever as there's 300+ files.

Is there a way to use the command line version of ExifTool to change the creation date based on the Filename?

Example Filename = 2011-12-22_19-06-39.mp4

Could anyone share a command line that will allow me to batch update all the files in a folder?

Appreciate anyone taking the time to read this and even more so, to those who reply :)

Thanks all

Dave

Example of Filenames:

Screenshot 2022-09-30 at 17.36.36.png
Title: Re: Change Creation Date of MP4 based on File Name (MacOS)
Post by: wywh on September 30, 2022, 01:36:35 PM
Try this:

exiftool -api QuickTimeUTC=1 '-AllDates<FileName' '-Track*Date<FileName' '-Media*Date<FileName' '-Keys:CreationDate<FileName' -execute '-FileCreateDate<FileName' '-FileModifyDate<FileName' -common_args -m -P -overwrite_original_in_place -wm w .
...which should give something like:

exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All 2011-12-22_19-06-39.mp4
[System]        FileModifyDate                  : 2011:12:22 19:06:39+02:00
[QuickTime]     CreateDate                      : 2011:12:22 19:06:39+02:00

- Matti
Title: Re: Change Creation Date of MP4 based on File Name (MacOS)
Post by: DaveS on October 02, 2022, 06:52:29 AM
Thank you so much! That worked perfectly. I would never had figured that out alone.

Really appreciate your help on this.

Thanks again

Dave  :)

Quote from: wywh on September 30, 2022, 01:36:35 PMTry this:

exiftool -api QuickTimeUTC=1 '-AllDates<FileName' '-Track*Date<FileName' '-Media*Date<FileName' '-Keys:CreationDate<FileName' -execute '-FileCreateDate<FileName' '-FileModifyDate<FileName' -common_args -m -P -overwrite_original_in_place -wm w .
...which should give something like:

exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All 2011-12-22_19-06-39.mp4
[System]        FileModifyDate                  : 2011:12:22 19:06:39+02:00
[QuickTime]     CreateDate                      : 2011:12:22 19:06:39+02:00

- Matti