Add Creation Date key to existing MOV file or timezone suffix to Create Date tag

Started by bobo, September 05, 2020, 05:35:59 AM

Previous topic - Next topic

bobo

Hey all,

Looking into the metadata from videos which come off of the iPhone, it seems like Apple's apps use "Creation Date" instead of the QuickTime UTC time to sort the videos in the iPhone Gallery and OSX Photos apps.

iOS 13 H264 Video File:
[System]        File Access Date/Time           : 2020:09:02 20:30:13-07:00
[System]        File Inode Change Date/Time     : 2020:09:05 01:59:35-07:00
[QuickTime]     Create Date                     : 2015:05:30 19:37:40
[QuickTime]     Modify Date                     : 2015:05:30 19:37:55
[Track1]        Track Create Date               : 2015:05:30 19:37:40
[Track1]        Track Modify Date               : 2015:05:30 19:37:55
[Track1]        Media Create Date               : 2015:05:30 19:37:40
[Track1]        Media Modify Date               : 2015:05:30 19:37:55
[Track2]        Track Create Date               : 2015:05:30 19:37:40
[Track2]        Track Modify Date               : 2015:05:30 19:37:55
[Track2]        Media Create Date               : 2015:05:30 19:37:40
[Track2]        Media Modify Date               : 2015:05:30 19:37:55
[Keys]          Creation Date (und-CA)          : 2015:05:30 12:37:40-07:00
[UserData]      Content Create Date             : 2015:05:30 12:37:40-07:00
[Keys]          Creation Date                   : 2015:05:30 12:37:40-07:00

The time reported in iOS/OSX Photos is 12:37:40.

Now when MOV files which come off of my Canon camera are imported into and Apple devices, those MOV files are correctly timed in UTC (since the camera has the correct time zone set).

However, since Apple devices do not understand those tags, Photos/iPhone appear to fall back onto a different tag, and fall back to what I believe is the QuickTime Create Date. Since this date does not have a time zone, the local system timezone is used by the devices (iPhone/OSX Photos) to offset (in my case its -7 since I'm on the west coast).

Canon DSLR MOV:
[System]        File Modification Date/Time     : 2016:03:30 15:14:42-07:00
[System]        File Access Date/Time           : 2020:09:04 02:04:27-07:00
[System]        File Inode Change Date/Time     : 2020:08:30 16:31:36-07:00
[IFD0]          Modify Date                     : 2016:03:30 15:14:35
[ExifIFD]       Date/Time Original              : 2016:03:30 15:14:35
[ExifIFD]       Create Date                     : 2016:03:30 15:14:35
[Canon]         Time Zone                       : -05:00
[Canon]         Time Zone City                  : Chicago
[Canon]         Daylight Savings                : On
[ExifIFD]       Sub Sec Time                    : 16
[ExifIFD]       Sub Sec Time Original           : 16
[ExifIFD]       Sub Sec Time Digitized          : 16
[QuickTime]     Create Date                     : 2016:03:30 15:14:35
[QuickTime]     Modify Date                     : 2016:03:30 15:14:35
[Track1]        Track Create Date               : 2016:03:30 15:14:35
[Track1]        Track Modify Date               : 2016:03:30 15:14:35
[Track1]        Media Create Date               : 2016:03:30 15:14:35
[Track1]        Media Modify Date               : 2016:03:30 15:14:35
[Track2]        Track Create Date               : 2016:03:30 15:14:35
[Track2]        Track Modify Date               : 2016:03:30 15:14:35
[Track2]        Media Create Date               : 2016:03:30 15:14:35
[Track2]        Media Modify Date               : 2016:03:30 15:14:35
[Composite]     Create Date                     : 2016:03:30 15:14:35.16
[Composite]     Date/Time Original              : 2016:03:30 15:14:35.16
[Composite]     Modify Date                     : 2016:03:30 15:14:35.16

In this case, the time reported by Photos/iPhone is 8:14:35 AM, which is the QuickTime create data subtracted by the system time zone 15:14:35 (-7 my local system timezone).

I'm trying to figure out what the cleanest way of fixing the MOV video files such that the photos and videos are sorted correctly in Photos/iPhone gallery.

Here is my thinking:
* I would prefer not to shift the Canon video QuickTime capture times - this is due to the fact that they will indefinitely contain an incorrect baked in +8 offset which may will become invalid as my devices move through different timezones.

* I can only think of a few other solutions:
1 - add the CreationDate "key" to the Canon MOV files - I am not sure if ExifTool has ability to add this key if it doesn't exit to begin with.
2 - re-mux all video files into new MOV container which has the key natively, and modify the Creation Date key.
--> I have tried using FFmpeg to remux into MOV container, but the resulting MOV files do not contain the Creation Date key.
3 - inject a timezone suffix into the QuickTime Create Date/Modify Date and hope that Photos/iOS can parse it in the same format as Creation Date.
4 - Just use one damn camera all the time.


I would appreciate any input or suggestions on this!

Thanks a bunch.

- Borna





StarGeek

Quote from: bobo on September 05, 2020, 05:35:59 AM
1 - add the CreationDate "key" to the Canon MOV files - I am not sure if ExifTool has ability to add this key if it doesn't exit to begin with.

Exiftool can do this as long as you have a fairly recent version, within the last year.

Quote2 - re-mux all video files into new MOV container which has the key natively, and modify the Creation Date key.
--> I have tried using FFmpeg to remux into MOV container, but the resulting MOV files do not contain the Creation Date key.

I believe you'll also lose the embedded EXIF and Canon MakerNotes doing this.

Quote3 - inject a timezone suffix into the QuickTime Create Date/Modify Date and hope that Photos/iOS can parse it in the same format as Creation Date.

Assuming that the time zone in that example is correctly set at -05:00 and the time is the correct local time for where it was shot (15:14:35), then you could use
exiftool "-Quicktime:CreationDate<$CreateDate$TimeZone" /path/to/files/
And then follow up with
exiftool -api QuickTimeUTC "-Quicktime:CreateDate<Quicktime:CreationDate" /path/to/files
which would correct the Quicktime:CreateDate.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

bobo

Thanks StarGeek  :)

I was able to get this format to work, the tag is added and the time is recognized by iOS/OSX

exiftool -verbose "-Quicktime:CreationDate=2016:03:30 15:33:01:-4:00" test.mov

However, various other formats resulted in errors:

I was able to get the below format to work, but without the timezone:

exiftool -verbose "-Quicktime:CreationDate<Quicktime:CreateDate" test.mov
    1 image files updated

I also tried:

exiftool -verbose "-Quicktime:CreationDate<{Quicktime:CreateDate}{Canon:TimeZone}" test.mov
exiftool -verbose "-Quicktime:CreationDate<$Quicktime:CreateDate$Canon:TimeZone" test.mov

Setting new values from test.mov
Warning: No writable tags set from test.mov
Nothing changed in after.mov
    0 image files updated
    1 image files unchanged

Do I have to build a string separately to concatenate two tags without spaces?



Using latest exiftool (12.05), here is the test MOV (16MB): https://drive.google.com/file/d/1CGfHf_B-wZPcAsO6Smfa8ePR2x1nAfzs/view

Thanks,

- Borna


StarGeek

If you're on Mac, swap single/double quotes in my example commands.

Also, double check that the name of the time zone tag.  Run
exiftool -time:all -G1 -a -s test.mov
to get tag names, not descriptions.  I made an assumption about the name of the time zone tag, but I could be wrong.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

bobo

Wow ... that was it. It was single quotes instead of double quotes on a Mac  :(

exiftool -verbose '-Quicktime:CreationDate<$Quicktime:CreateDate$Canon:TimeZone' test.mov

worked like a charm!

Thank you much  :)

Tonio

Quote from: StarGeek on September 05, 2020, 11:20:41 AMexiftool "-Quicktime:CreationDate<$CreateDate$TimeZone" /path/to/files/
And then follow up with
exiftool -api QuickTimeUTC "-Quicktime:CreateDate<Quicktime:CreationDate" /path/to/files

Hello StarGeek,

I have the same problem and ExifTool tells me "no writable tags set from" dir

Would you have an idea of what occurred?

Thank you

Tonio

Phil Harvey

If ExifTool says "No writable tags" then you are likely trying to copy from tags that don't exist.  Try this command to see which of these tags exist:

exiftool -createdate -timezone -creationdate -a -G1 -s FILE

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).