fixing dates for Canon S120 MP4 files in Google Photos

Started by boombass, September 02, 2023, 04:08:45 PM

Previous topic - Next topic

boombass

Hello everyone. I have some video files from my Canon S120 that are showing up in the wrong order in Google Photos. I had this problem years ago and I thought it was fixed, but now it's happening again and I can't figure it out.

I'm going to attach the ExifTool output for two files, the first is a JPG photo and the second is an MP4 file. They were taken in sequence, the video a few seconds after the photo.

To get the output I used this command in ExifTool: exiftool -time:all -a -G0:1 -s FILE

In Google Photos, the photo correctly displays the time and date of August 20, 11:51 am. The video incorrectly shows August 19, 8:51 pm. The video is 15 hours behind where it should be.

I think Google Photos sorts by CreateDate, but my old script for changing CreateDate isn't working. My old command was: exiftool '-createdate<datetimeoriginal' -if '($filetype eq "MP4")' <dir>

My old script makes the video file sort as August 20, 5:51 am. 6 hours earlier than the DateTimeOriginal.

The pictures were taken in Japan, 15 hours ahead of where I live in the MST time zone. I thought about adding 9 hours to the CreateDate, but I don't know how to do that.

I am very confused and would appreciate any help.

Here is the output for the photo:
exiftool -time:all -a -G0:1 -s /Users/username/Pictures/__Japan\ plus/CANON_DC/IMG_2874.JPG
[File:System]   FileModifyDate                  : 2023:08:20 11:51:26-06:00
[File:System]   FileAccessDate                  : 2023:09:01 06:15:11-06:00
[File:System]   FileInodeChangeDate             : 2023:08:25 09:02:18-06:00
[EXIF:IFD0]     ModifyDate                      : 2023:08:20 11:51:26
[EXIF:ExifIFD]  DateTimeOriginal                : 2023:08:20 11:51:26
[EXIF:ExifIFD]  CreateDate                      : 2023:08:20 11:51:26
[MakerNotes:Canon] TimeZone                     : +09:00
[MakerNotes:Canon] TimeZoneCity                 : (not set)
[MakerNotes:Canon] DaylightSavings              : Off

And here is the output for the video:
exiftool -time:all -a -G0:1 -s /Users/username/Pictures/__Japan\ plus/CANON_DC/MVI_2875.MP4
[File:System]   FileModifyDate                  : 2023:08:20 11:51:28-06:00
[File:System]   FileAccessDate                  : 2023:08:31 06:10:13-06:00
[File:System]   FileInodeChangeDate             : 2023:08:25 09:02:20-06:00
[EXIF:IFD0]     ModifyDate                      : 2023:08:20 11:51:29
[EXIF:ExifIFD]  DateTimeOriginal                : 2023:08:20 11:51:29
[EXIF:ExifIFD]  CreateDate                      : 2023:08:20 11:51:29
[MakerNotes:Canon] TimeZone                     : +09:00
[MakerNotes:Canon] TimeZoneCity                 : (not set)
[MakerNotes:Canon] DaylightSavings              : Off
[QuickTime]     CreateDate                      : 2023:08:20 02:51:29
[QuickTime]     ModifyDate                      : 2023:08:20 02:51:29
[QuickTime:Track1] TrackCreateDate              : 2023:08:20 02:51:29
[QuickTime:Track1] TrackModifyDate              : 2023:08:20 02:51:29
[QuickTime:Track1] MediaCreateDate              : 2023:08:20 02:51:29
[QuickTime:Track1] MediaModifyDate              : 2023:08:20 02:51:29
[QuickTime:Track2] TrackCreateDate              : 2023:08:20 02:51:29
[QuickTime:Track2] TrackModifyDate              : 2023:08:20 02:51:29
[QuickTime:Track2] MediaCreateDate              : 2023:08:20 02:51:29
[QuickTime:Track2] MediaModifyDate              : 2023:08:20 02:51:29

StarGeek

My standard copy/paste regarding video time stamps

Most video time stamps are supposed to be set to UTC and the program is supposed to adjust this to the local time zone when displayed (see 4th paragraph on the Quicktime tags page), with the most common exceptions being the Quicktime:CreationDate (not to be confused with the Quicktime:CreateDate) and the Quicktime:DateTimeOriginal.


If the correct time for the video is the same as the image ~2023:08:20 11:51, then the video time stamps are correctly set.  11:51 - 9 = UTC 02:51

It looks like when you uploaded it, Google assumed the correct time zone was your current one, which is -06:00 (correct?).  Subtract 6 from the UTC of ~2023:08:20 02:51 gives you ~2023:08:19 08:51.

I'm not sure what Google reads in video files (I've long since given up trying to figure out that madness) but I believe if Google knows the GPS location, then it will adjust the time zone.  You might try writing approximate GPS coordinatesto GPSCoordinates in the video before uploading.  For example, using the coordinates Google returns for Tokyo
exiftool -GPSCoordinates="35.67637, 139.65028" /path/to/files/

Otherwise, try to "Add a Location" under the info section of the file, i.e. Click the video, click the  ⓘ.  "Add a Location" will be at the bottom right.
* 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).

boombass

Thank you for your reply. I tried a few of the things you suggested.

I added GPS information to the file, using the command exiftool -GPSCoordinates="34.684981, 135.839944" /path/to/files/, but that had no effect on the sort order in Google Photos.

To an unmodified version of the file, I added a location in Google Photos, but this did not help either.

I think Canon gets some of the blame: the camera has a time zone setting for "Home" and "World". I used "World" for all of the pictures and videos I took while in Japan on vacation. The pictures sort correctly, the videos do not.

I took some test pictures and videos at home using the "Home" and "World" settings. The only difference is the TimeZone tag.

Here is the output for a "Home" and a "World" video, taken moments apart:

Home:
exiftool -time:all -a -G0:1 -s /Users/jonathanlocicero/Desktop/files\ for\ date\ test\ \(original\)/MVI_2937.MP4
[File:System]   FileModifyDate                  : 2023:09:04 12:17:30-06:00
[File:System]   FileAccessDate                  : 2023:09:04 20:37:00-06:00
[File:System]   FileInodeChangeDate             : 2023:09:04 12:23:24-06:00
[EXIF:IFD0]     ModifyDate                      : 2023:09:04 12:17:30
[EXIF:ExifIFD]  DateTimeOriginal                : 2023:09:04 12:17:30
[EXIF:ExifIFD]  CreateDate                      : 2023:09:04 12:17:30
[MakerNotes:Canon] TimeZone                     : -06:00
[MakerNotes:Canon] TimeZoneCity                 : (not set)
[MakerNotes:Canon] DaylightSavings              : On
[QuickTime]     CreateDate                      : 2023:09:04 18:17:30
[QuickTime]     ModifyDate                      : 2023:09:04 18:17:30
[QuickTime:Track1] TrackCreateDate              : 2023:09:04 18:17:30
[QuickTime:Track1] TrackModifyDate              : 2023:09:04 18:17:30
[QuickTime:Track1] MediaCreateDate              : 2023:09:04 18:17:30
[QuickTime:Track1] MediaModifyDate              : 2023:09:04 18:17:30
[QuickTime:Track2] TrackCreateDate              : 2023:09:04 18:17:30
[QuickTime:Track2] TrackModifyDate              : 2023:09:04 18:17:30
[QuickTime:Track2] MediaCreateDate              : 2023:09:04 18:17:30
[QuickTime:Track2] MediaModifyDate              : 2023:09:04 18:17:30

World:
[File:System]   FileModifyDate                  : 2023:09:05 03:18:42-06:00
[File:System]   FileAccessDate                  : 2023:09:04 20:37:48-06:00
[File:System]   FileInodeChangeDate             : 2023:09:04 12:23:24-06:00
[EXIF:IFD0]     ModifyDate                      : 2023:09:05 03:18:43
[EXIF:ExifIFD]  DateTimeOriginal                : 2023:09:05 03:18:43
[EXIF:ExifIFD]  CreateDate                      : 2023:09:05 03:18:43
[MakerNotes:Canon] TimeZone                     : +09:00
[MakerNotes:Canon] TimeZoneCity                 : (not set)
[MakerNotes:Canon] DaylightSavings              : Off
[QuickTime]     CreateDate                      : 2023:09:04 18:18:43
[QuickTime]     ModifyDate                      : 2023:09:04 18:18:43
[QuickTime:Track1] TrackCreateDate              : 2023:09:04 18:18:43
[QuickTime:Track1] TrackModifyDate              : 2023:09:04 18:18:43
[QuickTime:Track1] MediaCreateDate              : 2023:09:04 18:18:43
[QuickTime:Track1] MediaModifyDate              : 2023:09:04 18:18:43
[QuickTime:Track2] TrackCreateDate              : 2023:09:04 18:18:43
[QuickTime:Track2] TrackModifyDate              : 2023:09:04 18:18:43
[QuickTime:Track2] MediaCreateDate              : 2023:09:04 18:18:43
[QuickTime:Track2] MediaModifyDate              : 2023:09:04 18:18:43

Can I use ExifTool to change the TimeZone tag? I want to change my "World" videos from my trip from +09:00 to -06:00 and see if that fixes the sort.

Thanks again for your help, and I hope this sheds some light.

StarGeek

Quote from: boombass on September 07, 2023, 09:26:52 PMI added GPS information to the file, using the command exiftool -GPSCoordinates="34.684981, 135.839944" /path/to/files/, but that had no effect on the sort order in Google Photos.

To an unmodified version of the file, I added a location in Google Photos, but this did not help either.

Hmmm...  I don't know then.  It's been a while since I tested files on Google photos, as I've pretty much given up on dealing with all the annoyances and changes.  It just takes too much time to test it all.

QuoteI think Canon gets some of the blame: the camera has a time zone setting for "Home" and "World".

That's interesting.  Did you see anything in the full output that indicated if that setting was saved in the file?  You can run this command to see only the MakerNotes
exiftool -G1 -a -s -MakerNotes:All /path/to/files/

I took some test pictures and videos at home using the "Home" and "World" settings. The only difference is the TimeZone tag.

QuoteCan I use ExifTool to change the TimeZone tag?

You should be able to. Run this command to verify
exiftool -TimeZone=+09:00 /path/to/files/
* 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).

boombass

Hello again.

QuoteThat's interesting.  Did you see anything in the full output that indicated if that setting was saved in the file?  You can run this command to see only the MakerNotes

Here is the output for exiftool -G1 -a -s -MakerNotes:All /path/to/files/:

S120 "Home" MP4
[Canon]         CompressorVersion               : CanonMP4_002/05.00.00/00.00.02
[Canon]         MacroMode                       : Normal
[Canon]         SelfTimer                       : Off
[Canon]         Quality                         : Light (RAW)
[Canon]         CanonFlashMode                  : Off
[Canon]         ContinuousDrive                 : Movie
[Canon]         FocusMode                       : Single
[Canon]         RecordMode                      : MP4
[Canon]         CanonImageSize                  : 1920x1080 Movie
[Canon]         EasyMode                        : Full auto
[Canon]         DigitalZoom                     : None
[Canon]         Contrast                        : Normal
[Canon]         Saturation                      : Normal
[Canon]         Sharpness                       : 0
[Canon]         CameraISO                       : Auto
[Canon]         MeteringMode                    : Evaluative
[Canon]         FocusRange                      : Auto
[Canon]         AFPoint                         : Face Detect
[Canon]         CanonExposureMode               : Program AE
[Canon]         LensType                        : n/a
[Canon]         MaxFocalLength                  : 26 mm
[Canon]         MinFocalLength                  : 5.2 mm
[Canon]         FocalUnits                      : 1000/mm
[Canon]         MaxAperture                     : 1.8
[Canon]         MinAperture                     : 8
[Canon]         FlashBits                       : (none)
[Canon]         FocusContinuous                 : Continuous
[Canon]         AESetting                       : Normal AE
[Canon]         ImageStabilization              : On (2)
[Canon]         ZoomSourceWidth                 : 4000
[Canon]         ZoomTargetWidth                 : 4000
[Canon]         SpotMeteringMode                : Center
[Canon]         ManualFlashOutput               : n/a
[Canon]         AutoISO                         : 248
[Canon]         BaseISO                         : 200
[Canon]         MeasuredEV                      : 5.28
[Canon]         TargetAperture                  : 1.8
[Canon]         TargetExposureTime              : 1/125
[Canon]         ExposureCompensation            : 0
[Canon]         WhiteBalance                    : Auto
[Canon]         SlowShutter                     : Off
[Canon]         SequenceNumber                  : 0
[Canon]         OpticalZoomCode                 : 0
[Canon]         FlashGuideNumber                : 0
[Canon]         FlashExposureComp               : 0
[Canon]         AutoExposureBracketing          : Off
[Canon]         AEBBracketValue                 : 0
[Canon]         ControlMode                     : Camera Local Control
[Canon]         FocusDistanceUpper              : 0.46 m
[Canon]         FocusDistanceLower              : 0 m
[Canon]         FNumber                         : 1.9
[Canon]         ExposureTime                    : 1/120
[Canon]         BulbDuration                    : 0
[Canon]         CameraType                      : Compact
[Canon]         AutoRotate                      : None
[Canon]         NDFilter                        : Off
[Canon]         SelfTimer2                      : 0
[Canon]         FlashOutput                     : 0
[Canon]         CanonImageType                  : MVI:PowerShot S120 Movie
[Canon]         CanonFirmwareVersion            : Firmware Version 1.01
[Canon]         FileNumber                      : 154-2937
[Canon]         CameraTemperature               : 24 C
[Canon]         CanonModelID                    : PowerShot S120
[Canon]         ThumbnailImageValidArea         : 0 159 15 104
[Canon]         DateStampMode                   : Off
[Canon]         MyColorMode                     : Off
[Canon]         FirmwareRevision                : 1.01 rev 1.00
[Canon]         Categories                      : (none)
[Canon]         AFAreaMode                      : Single-point AF
[Canon]         NumAFPoints                     : 9
[Canon]         ValidAFPoints                   : 1
[Canon]         CanonImageWidth                 : 1920
[Canon]         CanonImageHeight                : 1080
[Canon]         AFImageWidth                    : 4000
[Canon]         AFImageHeight                   : 3000
[Canon]         AFAreaWidths                    : 900 0 0 -6536 -18812 0 -7196 -1 -32004
[Canon]         AFAreaHeights                   : 525 1 -6536 -1 17583 -7196 0 59 11419
[Canon]         AFAreaXPositions                : 0 8518 8743 9272 10873 13419 -6584 0 1024
[Canon]         AFAreaYPositions                : -261 8598 8823 10073 11723 -6580 1024 1 524
[Canon]         AFPointsInFocus                 : (none)
[Canon]         PrimaryAFPoint                  : 0
[Canon]         IntelligentContrast             : Off
[Canon]         ImageUniqueID                   : 5791821cee8a09b682f473ac1d5a2786
[Canon]         FacesDetected                   : 65535
[Canon]         TimeZone                        : -06:00
[Canon]         TimeZoneCity                    : (not set)
[Canon]         DaylightSavings                 : On
[Canon]         AspectRatio                     : 16:9
[Canon]         CroppedImageWidth               : 1920
[Canon]         CroppedImageHeight              : 1080
[Canon]         CroppedImageLeft                : 0
[Canon]         CroppedImageTop                 : 0
[Canon]         VRDOffset                       : 0
[Canon]         ThumbnailImage                  : (Binary data 9650 bytes, use -b option to extract)

S120 "World" MP4
[Canon]         CompressorVersion               : CanonMP4_002/05.00.00/00.00.02
[Canon]         MacroMode                       : Normal
[Canon]         SelfTimer                       : Off
[Canon]         Quality                         : Light (RAW)
[Canon]         CanonFlashMode                  : Off
[Canon]         ContinuousDrive                 : Movie
[Canon]         FocusMode                       : Single
[Canon]         RecordMode                      : MP4
[Canon]         CanonImageSize                  : 1920x1080 Movie
[Canon]         EasyMode                        : Full auto
[Canon]         DigitalZoom                     : None
[Canon]         Contrast                        : Normal
[Canon]         Saturation                      : Normal
[Canon]         Sharpness                       : 0
[Canon]         CameraISO                       : Auto
[Canon]         MeteringMode                    : Evaluative
[Canon]         FocusRange                      : Auto
[Canon]         AFPoint                         : Face Detect
[Canon]         CanonExposureMode               : Program AE
[Canon]         LensType                        : n/a
[Canon]         MaxFocalLength                  : 26 mm
[Canon]         MinFocalLength                  : 5.2 mm
[Canon]         FocalUnits                      : 1000/mm
[Canon]         MaxAperture                     : 1.8
[Canon]         MinAperture                     : 8
[Canon]         FlashBits                       : (none)
[Canon]         FocusContinuous                 : Continuous
[Canon]         AESetting                       : Normal AE
[Canon]         ImageStabilization              : On (2)
[Canon]         ZoomSourceWidth                 : 4000
[Canon]         ZoomTargetWidth                 : 4000
[Canon]         SpotMeteringMode                : Center
[Canon]         ManualFlashOutput               : n/a
[Canon]         AutoISO                         : 295
[Canon]         BaseISO                         : 200
[Canon]         MeasuredEV                      : 5.06
[Canon]         TargetAperture                  : 1.8
[Canon]         TargetExposureTime              : 1/125
[Canon]         ExposureCompensation            : 0
[Canon]         WhiteBalance                    : Auto
[Canon]         SlowShutter                     : Off
[Canon]         SequenceNumber                  : 0
[Canon]         OpticalZoomCode                 : 0
[Canon]         FlashGuideNumber                : 0
[Canon]         FlashExposureComp               : 0
[Canon]         AutoExposureBracketing          : Off
[Canon]         AEBBracketValue                 : 0
[Canon]         ControlMode                     : Camera Local Control
[Canon]         FocusDistanceUpper              : 0.62 m
[Canon]         FocusDistanceLower              : 0 m
[Canon]         FNumber                         : 1.9
[Canon]         ExposureTime                    : 1/120
[Canon]         BulbDuration                    : 0
[Canon]         CameraType                      : Compact
[Canon]         AutoRotate                      : None
[Canon]         NDFilter                        : Off
[Canon]         SelfTimer2                      : 0
[Canon]         FlashOutput                     : 0
[Canon]         CanonImageType                  : MVI:PowerShot S120 Movie
[Canon]         CanonFirmwareVersion            : Firmware Version 1.01
[Canon]         FileNumber                      : 154-2940
[Canon]         CameraTemperature               : 25 C
[Canon]         CanonModelID                    : PowerShot S120
[Canon]         ThumbnailImageValidArea         : 0 159 15 104
[Canon]         DateStampMode                   : Off
[Canon]         MyColorMode                     : Off
[Canon]         FirmwareRevision                : 1.01 rev 1.00
[Canon]         Categories                      : (none)
[Canon]         AFAreaMode                      : Single-point AF
[Canon]         NumAFPoints                     : 9
[Canon]         ValidAFPoints                   : 1
[Canon]         CanonImageWidth                 : 1920
[Canon]         CanonImageHeight                : 1080
[Canon]         AFImageWidth                    : 4000
[Canon]         AFImageHeight                   : 3000
[Canon]         AFAreaWidths                    : 800 0 0 -6536 -18812 0 -7196 -1 -32052
[Canon]         AFAreaHeights                   : 899 1 -6536 -1 17583 -7196 0 59 11419
[Canon]         AFAreaXPositions                : 200 8518 8743 9272 10873 13419 -6584 0 1024
[Canon]         AFAreaYPositions                : -111 8598 8823 10073 11723 -6580 1024 1 527
[Canon]         AFPointsInFocus                 : (none)
[Canon]         PrimaryAFPoint                  : 0
[Canon]         IntelligentContrast             : Off
[Canon]         ImageUniqueID                   : 509108b5e88a09b682f473ac1d5a2786
[Canon]         FacesDetected                   : 65535
[Canon]         TimeZone                        : +09:00
[Canon]         TimeZoneCity                    : (not set)
[Canon]         DaylightSavings                 : Off
[Canon]         AspectRatio                     : 16:9
[Canon]         CroppedImageWidth               : 1920
[Canon]         CroppedImageHeight              : 1080
[Canon]         CroppedImageLeft                : 0
[Canon]         CroppedImageTop                 : 0
[Canon]         VRDOffset                       : 0
[Canon]         ThumbnailImage                  : (Binary data 9696 bytes, use -b option to extract)

The only thing that changes is the [Canon] TimeZone tag.

QuoteYou should be able to. Run this command to verify
exiftool -TimeZone=+09:00 /path/to/files/

I tried this, and ExifTool returned:
exiftool -TimeZone=+09:00 /path/to/files/MVI_2875.MP4
    0 image files updated
    1 image files unchanged
That didn't work.

But according to the documentation here, ExifTool can write to the Canon TimeZone tag. How exactly can I do that?

Thanks again!

StarGeek

Quote from: boombass on September 10, 2023, 01:49:57 PMThe only thing that changes is the [Canon] TimeZone tag.

I have no idea then.

QuoteI tried this, and ExifTool returned:
exiftool -TimeZone=+09:00 /path/to/files/MVI_2875.MP4
    0 image files updated
    1 image files unchanged
That didn't work.

But according to the documentation here, ExifTool can write to the Canon TimeZone tag. How exactly can I do that?

Ah, sorry, forgot it was a video. It would work for an image file.

Unfortunately, there isn't a standard for writing EXIF in a video file, so every camera writes it differently.  Exiftool can sometimes edit EXIF in a video file, but not always. It err on the side of caution and not write to those files so as to not damage the video.
* 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).

boombass

QuoteAh, sorry, forgot it was a video. It would work for an image file.

Unfortunately, there isn't a standard for writing EXIF in a video file, so every camera writes it differently.  Exiftool can sometimes edit EXIF in a video file, but not always. It err on the side of caution and not write to those files so as to not damage the video.

Ahh, I see. That's too bad.

I think I've taken this about as far as it can go. Thank you for your all of your help, and your willingness to answer my questions. You are very kind and generous.