ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: SRPilot on November 26, 2023, 09:49:24 AM

Title: Update Media Create Date from "GPS Data Time" field?
Post by: SRPilot on November 26, 2023, 09:49:24 AM
The battery on my GoPro9 discharged so the time reverted to January 1,2016 so all the "Media Create Date" times are wrong.

I ran the following command exiftool -ee  GXBZ2076.MP4 on a file and found that there is GPS date time information embedded in the file.  (There are many lines of GPS Date Time) 

What would be the command to update the Media Creation Date from the GPS Date Time?

If this has been asked and answered before, I'd appreciate a link to the forum topic as I couldn't properly phrase the question to find it in a search of the forum.
Title: Re: Update Media Create Date from "GPS Data Time" field?
Post by: StarGeek on November 26, 2023, 10:15:40 AM
Since you didn't mention your OS, I'm assuming it's Windows due to your use of the term "Media Create Date".

The Windows "Media Create Date" property is stored in the Quicktime:CreateDate tag (see the Windows metadata post (https://exiftool.org/forum/index.php?topic=6591.msg32875#msg32875)).

Try this command
exiftool -ee "-Quicktime:CreateDate<GPSDateTime" /path/to/files/
Title: Re: Update Media Create Date from "GPS Data Time" field?
Post by: SRPilot on November 26, 2023, 01:24:59 PM
Thanks for the response.  I'm using a Macbook running MacOS 14.0.  Do I still use Quicktime:CreateDate?

When I run the command
exiftool -ee -GPSDateTime "GXAB0093-busy turnout.MP4"
it returns a value every second. 
GPS Date Time                   : 2023:08:07 17:07:58.739
GPS Date Time                   : 2023:08:07 17:07:59.729
GPS Date Time                   : 2023:08:07 17:08:00.719
GPS Date Time                   : 2023:08:07 17:08:01.764
.
.
.

If I run the code above, will it use the first or last GPS Date Time?
I assume the GPS Date Time is UCS, so I will also need to correct that to the local time.
Title: Re: Update Media Create Date from "GPS Data Time" field?
Post by: StarGeek on November 26, 2023, 07:41:05 PM
Quote from: SRPilot on November 26, 2023, 01:24:59 PMThanks for the response.  I'm using a Macbook running MacOS 14.0.  Do I still use Quicktime:CreateDate?

This I cannot answer, as I don't use a Mac so I can't test it.  Try it and see if it changes to the correct time.  If not, then you will have to figure out what is the correct tag to write to.

To do this, find a file that shows the correct "Media Create Date".  Then run this command
exiftool -time:all -G1 -a -s file.mp4
Check the results to see what tag has the same time stamp as your "Media Create Date".  That would be the tag you would copy to.

QuoteIf I run the code above, will it use the first or last GPS Date Time?

You will have to try it and see. In the test I ran here, it used the first GPSDateTime and I think that should be what happens for you,  but I don't have a GoPro video, so something might be different.

QuoteI assume the GPS Date Time is UCS, so I will also need to correct that to the local time.

No.  Most Quicktime time stamps are supposed to be in UTC, so no correction is needed.  The only time you would want to correct it is if you need to copy to the Quicktime:DateTimeOriginal or Quicktime:CreationDate (which is a different tag than the Quicktime:CreateDate).

If that is the case, you can add the -api QuickTimeUTC option (https://exiftool.org/ExifTool.html#QuickTimeUTC) and the time stamp will be shown as adjusted to the local time of the computer.  For example, the first output shows the UTC, the second shows how it was adjusted to my local time zone
C:\>exiftool -G1 -a -s -CreateDate Y:\!temp\Test11.mp4
[QuickTime]     CreateDate                      : 2023:11:26 12:00:00

C:\>exiftool -G1 -a -s -api QuickTimeUTC -CreateDate Y:\!temp\Test11.mp4
[QuickTime]     CreateDate                      : 2023:11:26 04:00:00-08:00
Title: Re: Update Media Create Date from "GPS Data Time" field?
Post by: SRPilot on November 26, 2023, 10:34:46 PM
When I ran the code
exiftool -ee "-Quicktime:CreateDate<GPSDateTime" /path/to/files/The Quicktime date was updated with the first entry as show in the output below:
[System]        FileModifyDate                  : 2023:11:26 19:04:34-06:00
[System]        FileAccessDate                  : 2023:11:26 19:04:32-06:00
[System]        FileInodeChangeDate             : 2023:11:26 19:04:34-06:00
[QuickTime]     CreateDate                      : 2023:08:07 17:07:59
[QuickTime]     ModifyDate                      : 2016:01:01 00:22:37

I ran additional code to change all the dates shown above.  I'm still trying to find a DateTime field that Black Magic Davinci Resolve software will properly sort.  I have submitted a bug report to Black Magic as sorting on the System:FileModifyDate is not working properly.
Title: Re: Update Media Create Date from "GPS Data Time" field?
Post by: StarGeek on November 27, 2023, 01:47:08 AM
Have you tried removing the file from Davinci Resolve, running your command, and then re-adding it?  Davinci Resolve might not be checking the file for changed information after in has been added.
Title: Re: Update Media Create Date from "GPS Data Time" field?
Post by: SRPilot on November 27, 2023, 09:46:38 AM
Quote from: StarGeek on November 27, 2023, 01:47:08 AMHave you tried removing the file from Davinci Resolve, running your command, and then re-adding it?  Davinci Resolve might not be checking the file for changed information after in has been added.
Yes,  I did remove the file from Davinci Resolve in case it was caching the data.