Apple Photos doesn't recognize correct encoding date for mp4 file

Started by Resultant, December 23, 2019, 11:23:30 AM

Previous topic - Next topic

Phil Harvey

I finally got around to testing this myself in iPhoto (I really don't like Apple Photos, so I avoid using if I can).  Anyway, I ran this command:

exiftool "-quicktime:datetimeoriginal=1995:01:18 18:50:00" test.mp4

then imported this MP4 into Apple Photos and opened the Info window from the Window/Info menu.  This window showed "Jan 18 1995,  1:50:00 PM", which is correct for my time zone assuming 18:50 was UTC time.

I tested this on MacOS 10.13.6 with Photos version 3.0

So it appears that Exiftool is writing QuickTime:DateTimeOriginal correctly.  At least it is compatible with this version of Apple Photos.

So for now I won't change anything about the way that ExifTool is writing this tag.

- 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 ($).

wywh

Quote from: Resultant on December 23, 2019, 11:23:30 AM
shows up in Apple Photos as "November 24, 183057   7:15:10 PM". Yes, you read that correct - 183057.

Forgive me replying to an oldish thread but I, too, lost some hair because of this until I noticed that if "[Keys] CreationDate", "[UserData] DateTimeOriginal" and obviously also "[Quicktime] DateTimeOriginal" lack a timezone like +02:00, then Catalina's Photos.app 5.0 generates weird scrambled datetimes with the year displayed something like "177294" etc. So it is important to make sure a timezone is set there. For example, some exiftool commands like "-AllDates<filename" create "[UserData] DateTimeOriginal" without timezone by default. Or use "-wm w" -- only write existing tags so that "-AllDates<filename" does not create a new "[UserData] DateTimeOriginal" tag.

Phil Harvey

...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 ($).

doomi

I can confirm the issue is related to the missing time zone!

I converted old AVI videos to mp4 with HandBrake and used exiftool with "-tagsfromfile" to apply the old dates to the new files.
but after importing into Photos on macOS Big Sur it showed a date in year 5828963!
"exiftool -time:all -a -G1 -s" showed correct timestamps, but the Photos app just messed it up...

after reading the previous comment I just added a timezone (+01:00 in my case) and now Photos imports it correctly.
it seems to work if just the DateTimeOriginal is having the additional timezone:
'-datetimeoriginal<$datetimeoriginal+01:00'

but I used time:all for my final command, like this:
exiftool -tagsfromfile original.avi '-quicktime:time:all<$datetimeoriginal+01:00' '-filemodifydate<datetimeoriginal' newfile.mp4

the timestamps of the working mp4 files look like this:
[System]        FileModifyDate                  : 2008:11:07 11:33:25+01:00
[System]        FileAccessDate                  : 2008:11:07 11:33:25+01:00
[System]        FileInodeChangeDate             : 2021:09:08 18:35:45+02:00
[QuickTime]     CreateDate                      : 2008:11:07 11:33:25
[QuickTime]     ModifyDate                      : 2008:11:07 11:33:25
[Track1]        TrackCreateDate                 : 2008:11:07 11:33:25
[Track1]        TrackModifyDate                 : 2008:11:07 11:33:25
[Track1]        MediaCreateDate                 : 2008:11:07 11:33:25
[Track1]        MediaModifyDate                 : 2008:11:07 11:33:25
[Track2]        TrackCreateDate                 : 2008:11:07 11:33:25
[Track2]        TrackModifyDate                 : 2008:11:07 11:33:25
[Track2]        MediaCreateDate                 : 2008:11:07 11:33:25
[Track2]        MediaModifyDate                 : 2008:11:07 11:33:25
[ItemList]      ReleaseDate                     : 2008:11:07 11:33:25+01:00
[ItemList]      ContentCreateDate               : 2008:11:07 11:33:25+01:00
[UserData]      DateTimeOriginal                : 2008:11:07 11:33:25+01:00
[Keys]          CreationDate                    : 2008:11:07 11:33:25+01:00
[Keys]          LocationDate                    : 2008:11:07 11:33:25+01:00
[Keys]          Year                            : 2008:11:07 11:33:25+01:00



I hope that helps others with the same issue!