News:

2023-08-10 - ExifTool version 12.65 released

Main Menu

Google Photos (again)

Started by chuckkahn, March 26, 2022, 07:58:32 PM

Previous topic - Next topic

chuckkahn

Adding date from mp4 filename to mp4 using "-alldates<filename"

zCKAvid:_FOR EXIFTOOL charleskahn$ exiftool "-alldates<filename" /Volumes/CK_10TB/Downloads\ iMac/_media\ for\ unRAID/Insta360\ ONE\ X/_FOR\ EXIFTOOL/IMG_20220318_165924_00_680_INTV_680_704\(1\).mp4
    1 image files updated
zCKAvid:_FOR EXIFTOOL charleskahn$ exiftool -alldates /Volumes/CK_10TB/Downloads\ iMac/_media\ for\ unRAID/Insta360\ ONE\ X/_FOR\ EXIFTOOL/IMG_20220318_165924_00_680_INTV_680_704\(1\).mp4
Date/Time Original              : 2022:03:18 16:59:24
Create Date                     : 2022:03:18 16:59:24
Modify Date                     : 2022:03:18 16:59:24


But Google Photos sees the time not as 16:59 but as 12:59.

What further exiftool parameters can I add to "prepare the way" for Google Photos and not have to manually adjust it after uploading?  (and can it be done in one command?)


StarGeek

Add the -api QuickTimeUTC option.

The time stamps in a video are supposed to be in UTC according to the spec.  See the 4th paragraph on the Quicktime tags page.  Adding -api QuickTimeUTC will tell exiftool to adjust to UTC based upon the timezone of the computer.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

wywh

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 .

https://discussions.apple.com/docs/DOC-250002750

Movies after 1970-0101-0000-00 (limit at UTC midnight) work fine with only QuickTime tags with the '-api QuickTimeUTC=1' option.

Movies before 1970 then obey the Keys:CreationDate. .m4v and .mov display correct time combined with the timezone but for some reason in .mp4 the timezone must be subtracted from the time. So for a 1921-0501-1200-00.mp4 I use at +02:00 timezone:

exiftool -m -P -overwrite_original_in_place '-Keys:CreationDate=1921:05:01 10:00:00+02:00' movie.mp4

p.s. YMMV but before 1921-0501-00-00 I also need 20 minutes 11 seconds added to the previously calculated time combined with a modified timezone +01:40 because many countries did some adjustments to in the late 1800's and here it happened at 1921.

Before year 1902 Keys:CreationDate works even to year 0001 in some apps Google Photos might randomly display a wrong date and even if it displays the correct date, it might sort that movie incorrectly.

- Matti