Greetings,
I've been using ExifTool for a while now to correct the dates for my photos and videos, largely by slowly reading and digesting the valuable information on this wonderful site. This however is my first post because I've now hit a brick wall.
I've successfully tagged numerous video files (mp4, mov) so that Apple Photos correctly identifies the date they were taken, so I'm not new to this process. However, as of late, I've run into an issue where videos captured and encoded from my old VHS tapes don't show up with the correct date taken using my trusted procedure. I've been using the -AllDates command to set the 3 key tags necessary (Create Date, Modify Date and Date/Time Original) which successfully does the trick to get Apple Photos to recognize the correct dates. I've learned that Media Create/Modify Date and Track Create/Modify Date are not really necessary to set for this purpose.
Here's the info of the file that I've set to "1995:01:18 18:50:00" and yet it shows up in Apple Photos as "November 24, 183057 7:15:10 PM". Yes, you read that correct - 183057. I'm facing a similar issue with numerous other videos and when I compare their ExifTool output to others that I've successfully converted, I can see NO discernible difference the types of fields/tages used etc. I'm stumped. Please help.
ExifTool Version Number : 11.80
File Name : ultra.mp4
Directory : .
File Size : 130 MB
File Modification Date/Time : 2019:12:23 06:50:03-08:00
File Access Date/Time : 2019:12:23 06:50:16-08:00
File Inode Change Date/Time : 2019:12:23 06:50:03-08:00
File Permissions : rwxrwxrwx
File Type : MP4
File Type Extension : mp4
MIME Type : video/mp4
Major Brand : MP4 v2 [ISO 14496-14]
Minor Version : 0.0.1
Compatible Brands : isom, mp41, mp42
Movie Header Version : 0
Time Scale : 30000
Duration : 0:13:03
Preferred Rate : 1
Preferred Volume : 100.00%
Preview Time : 0 s
Preview Duration : 0 s
Poster Time : 0 s
Selection Time : 0 s
Selection Duration : 0 s
Current Time : 0 s
Next Track ID : 3
Track Header Version : 0
Track Create Date : 2019:12:23 14:43:54
Track Modify Date : 2019:12:23 14:45:50
Track ID : 1
Track Duration : 0:13:03
Track Layer : 0
Track Volume : 100.00%
Balance : 0
Audio Format : mp4a
Audio Channels : 2
Audio Bits Per Sample : 16
Audio Sample Rate : 48000
Matrix Structure : 1 0 0 0 1 0 0 0 1
Image Width : 640
Image Height : 480
Media Header Version : 0
Media Create Date : 2019:12:23 14:43:54
Media Modify Date : 2019:12:23 14:45:50
Media Time Scale : 30000
Media Duration : 0:13:03
Media Language Code : und
Handler Type : Video Track
Handler Description : Core Media Video
Graphics Mode : srcCopy
Op Color : 0 0 0
Compressor ID : avc1
Source Image Width : 640
Source Image Height : 480
X Resolution : 72
Y Resolution : 72
Bit Depth : 24
Color Representation : nclx 6 1 6
Video Field Order : Progressive; 0
Pixel Aspect Ratio : 1:1
Video Frame Rate : 29.97
Clip File Name : original
Description : Sound Capture
Unknown Thumbnail : (Binary data 42827 bytes, use -b option to extract)
Author :
Title : original
XMP Toolkit : Image::ExifTool 11.80
Date/Time Original : 1995:01:18 18:50:00
Create Date : 1995:01:18 18:50:00
Modify Date : 1995:01:18 18:50:00
Movie Data Size : 135583983
Movie Data Offset : 345473
Image Size : 640x480
Megapixels : 0.307
Avg Bitrate : 1.38 Mbps
Rotation : 0
To help troubleshoot here's a few more things:
- Videos were captured from VHS using a PC program
- Local installation of Apple Photos is not a problem; the problem persists across different Macs
- Google Photos correctly recognizes the date created for the resulting videos
Use this command to show all time related tags and where they are located.
exiftool -time:all -g1 -a -s ultra.mp4
This command will show duplicate tags and the groups they belong to, which is very important when trying to figure where a problem might be.
Thanks StarGeek. Here's what I got:
---- System ----
FileModifyDate : 2019:12:23 06:50:03-08:00
FileAccessDate : 2019:12:23 09:12:24-08:00
FileInodeChangeDate : 2019:12:23 06:50:03-08:00
---- QuickTime ----
CreateDate : 1995:01:18 18:50:00
ModifyDate : 1995:01:18 18:50:00
---- Track1 ----
TrackCreateDate : 2019:12:23 14:43:54
TrackModifyDate : 2019:12:23 14:45:50
MediaCreateDate : 2019:12:23 14:43:54
MediaModifyDate : 2019:12:23 14:45:50
---- Track2 ----
TrackCreateDate : 2019:12:23 14:43:54
TrackModifyDate : 2019:12:23 14:45:50
MediaCreateDate : 2019:12:23 14:43:54
MediaModifyDate : 2019:12:23 14:45:50
---- UserData ----
DateTimeOriginal : 1995:01:18 18:50:00
---- XMP-exif ----
DateTimeOriginal : 1995:01:18 18:50:00
---- XMP-xmp ----
CreateDate : 1995:01:18 18:50:00
ModifyDate : 1995:01:18 18:50:00
I don't have any ideas as to how/why this could happen, but you may be able to narrow it down with some work. First, if you can determine which of the specific tags is causing the problem:
QuickTime:CreateDate, QuickTime:ModifyDate or UserData:DateTimeOriginal
(I doubt that the XMP tags would be the problem)
Once you find the date/time tag, try writing different values to find the latest date/time which gives a problem (I'm guessing Dec 1999).
Once it is narrowed down like this, I'll take a look at the specifications to see if I can come up with a theory as to how this could happen.
- Phil
Thanks Phil. I went to the original source capture that was done on a PC (and hence has nothing to do with QuickTime). I ran the -AllDates command, and the result is identical. Here are all the tags of the converted PC file (i.e. no QuickTime). So, I suppose QuickTime tags have nothing to do with the problem? Does this help narrow down?
exiftool -time:all -g1 -a -s originalpc.mp4
---- System ----
FileModifyDate : 2019:12:23 09:09:42-08:00
FileAccessDate : 2019:12:23 09:36:32-08:00
FileInodeChangeDate : 2019:12:23 09:09:42-08:00
---- QuickTime ----
CreateDate : 1995:01:18 18:50:00
ModifyDate : 1995:01:18 18:50:00
---- Track1 ----
TrackCreateDate : 2019:12:23 07:43:44
TrackModifyDate : 2019:12:23 07:43:44
MediaCreateDate : 2019:12:23 07:43:44
MediaModifyDate : 2019:12:23 07:43:44
---- Track2 ----
TrackCreateDate : 2019:12:23 07:43:44
TrackModifyDate : 2019:12:23 07:43:44
MediaCreateDate : 2019:12:23 07:43:44
MediaModifyDate : 2019:12:23 07:43:44
---- ItemList ----
ContentCreateDate : 2019:12:22
---- UserData ----
DateTimeOriginal : 1995:01:18 18:50:00
---- XMP-exif ----
DateTimeOriginal : 1995:01:18 18:50:00
---- XMP-xmp ----
CreateDate : 1995:01:18 18:50:00
ModifyDate : 1995:01:18 18:50:00
Also, changing the written date to "2005:01:18 18:50:00" produces "November 25, 183067 7:15:10 PM". So
"1995:01:18 18:50:00" results in "November 24, 183057 7:15:10 PM"
"2005:01:18 18:50:00" results in "November 25, 183067 7:15:10 PM"
Quote from: Resultant on December 23, 2019, 12:41:29 PM
Thanks Phil. I went to the original source capture that was done on a PC (and hence has nothing to do with QuickTime).
The MP4 file format is based on the QuickTime format, so in this respect it does have something to do with QuickTime.
Quote from: Resultant on December 23, 2019, 12:53:10 PM
Also, changing the written date to "2005:01:18 18:50:00" produces "November 25, 183067 7:15:10 PM".
Which specific tag causes this change?
Which tag(s) do you have to write with post-2000 dates to get Photos to display the proper date?
- Phil
I'm not sure I understand Phil (sorry, I'm a newbie). The only tags I write/update are the 3 tags using -AllDates. No matter what dates I use (post or pre 2000) using -AllDates, the result is still garbage. However, I CAN confirm that without using -AllDates, the video shows up with today's date (the date it was encoded). So clearly, running -AllDates is messing something up.
OK, so try starting from a file that shows the proper date/time in Photos and writing the tags I mentioned ( one at a time (QuickTime:CreateDate, QuickTime:ModifyDate and UserData:DateTimeOriginal) instead of using AllDates to see which one causes the problem.
And you say it is a problem no matter what date you write? Odd. I can't see how this would happen if you wrote the same date as was already in the file.
- Phil
SOLVED IT! Well sort of, without really understanding WHY the error was happening. As I suspected, the -AllDates was messing things up. I suspected, it was writing stuff that's probably not needed. So, instead of -AllDates, I did a -CreateDate and -ModifyDate and presto, Apple Photos picks up the correct date. So, I did a tags dump as a result of both operations, and you'll see that -AllDates creates "---- User Data----" section and "---- XMP-exif ----" sections that the -CreateDate and -ModifyDate operations do not. Why this is significant, I don't know, but would love to know since I've racked my brains on this for 6+ hours.
----------------- AllDates Operation ----------------
exiftool -time:all -g1 -a -s alldates.mp4
---- System ----
FileModifyDate : 2019:12:23 10:26:45-08:00
FileAccessDate : 2019:12:23 10:26:46-08:00
FileInodeChangeDate : 2019:12:23 10:26:45-08:00
---- QuickTime ----
CreateDate : 1999:05:23 14:01:46
ModifyDate : 1999:05:23 14:01:46
---- Track1 ----
TrackCreateDate : 2019:12:23 18:22:47
TrackModifyDate : 2019:12:23 18:22:54
MediaCreateDate : 2019:12:23 18:22:47
MediaModifyDate : 2019:12:23 18:22:54
---- Track2 ----
TrackCreateDate : 2019:12:23 18:22:47
TrackModifyDate : 2019:12:23 18:22:54
MediaCreateDate : 2019:12:23 18:22:47
MediaModifyDate : 2019:12:23 18:22:54
---- UserData ----
DateTimeOriginal : 1999:05:23 14:01:46
---- XMP-exif ----
DateTimeOriginal : 1999:05:23 14:01:46
---- XMP-xmp ----
CreateDate : 1999:05:23 14:01:46
ModifyDate : 1999:05:23 14:01:46
----------------- CreateDate and ModifyDate Operation ----------------
exiftool -time:all -g1 -a -s createandmodify.mp4
---- System ----
FileModifyDate : 2019:12:23 10:27:53-08:00
FileAccessDate : 2019:12:23 10:27:54-08:00
FileInodeChangeDate : 2019:12:23 10:27:53-08:00
---- QuickTime ----
CreateDate : 1999:05:23 14:01:46
ModifyDate : 1999:05:23 14:01:46
---- Track1 ----
TrackCreateDate : 2019:12:23 18:22:47
TrackModifyDate : 2019:12:23 18:22:54
MediaCreateDate : 2019:12:23 18:22:47
MediaModifyDate : 2019:12:23 18:22:54
---- Track2 ----
TrackCreateDate : 2019:12:23 18:22:47
TrackModifyDate : 2019:12:23 18:22:54
MediaCreateDate : 2019:12:23 18:22:47
MediaModifyDate : 2019:12:23 18:22:54
---- XMP-xmp ----
CreateDate : 1999:05:23 14:01:46
ModifyDate : 1999:05:23 14:01:46
Glad you got it solved. I was about to put up a video with timestamps set by FFMpeg for you to test next.
The XMP tags are probably ignored by Apple Photos. Adobe products are about the only things that read that data.
So was it the UserData:DateTimeOriginal that was causing the problem? (I doubt the XMP would cause this.)
If so, I'll look into this tag to see if I can figure out how this could happen.
- Phil
I did some digging into UserData:DateTimeOriginal. I don't have any samples which contain this information, but this reference (https://cconcolato.github.io/mp4ra/atoms.html) says it should be written in ISO 8601 format, which is what ExifTool is doing (see the user-data 'date' atom):
"Date and time, formatted according to ISO 8601, when the content was created. For clips captured by recording devices, this is typically the date and time when the clip's recording started."
However, I can't find reference to this tag in any Apple documentation.
Maybe I should make this tag read-only to prevent future confusion until we find a reason, and a compatible format to write for it.
- Phil
Hi Phil,
Very likely, it was the UserData:DateTimeOriginal that was causing the problem. I'm not smart enough to conclusively say that the XMP is not the problem. Just wanted to say THANK YOU for creating this Swiss Army Knife of a program. While it gives users enough rope to hang themselves, I'd rather be with it than without it. You're doing a terrific service by helping others like me curate their media. Best
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
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.
Thanks. That is a very useful hint.
- Phil
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!