Fixing time in Google Photos for MP4 files from Panasonic ZS100

Started by boombass, June 07, 2018, 04:10:22 PM

Previous topic - Next topic

boombass

Hi everyone. I'm trying out a new camera, a Panasonic ZS100, and uploading the files to Google Photos. As with the other cameras I've tried, Google Photos gets the time wrong for video files.

It seems that Google Photos uses the createdate tag to sort videos. In my old Canon S120 I used this exiftool command to alter the MP4 files so they would sort correctly when uploaded to Google Photos:

exiftool -P -overwrite_original_in_place '-createdate<datetimeoriginal' -if '($filetype eq "MP4")' <dir>

This command doesn't work on the Panasonic ZS100.

Here are the results of exiftool -api QuickTimeUTC -time:all -a -G0:1 -s on two files made with this camera, one a still image and one a video, within seconds of each other:

photo:
[File:System]   FileModifyDate                  : 2018:06:07 12:50:13-06:00
[File:System]   FileAccessDate                  : 2018:06:07 13:33:05-06:00
[File:System]   FileInodeChangeDate             : 2018:06:07 12:59:13-06:00
[EXIF:IFD0]     ModifyDate                      : 2018:06:07 12:50:13
[EXIF:ExifIFD]  DateTimeOriginal                : 2018:06:07 12:50:13
[EXIF:ExifIFD]  CreateDate                      : 2018:06:07 12:50:13
[MakerNotes:Panasonic] TimeStamp                : 2018:06:07 19:50:13
[EXIF:ExifIFD]  SubSecTime                      : 498
[EXIF:ExifIFD]  SubSecTimeOriginal              : 498
[EXIF:ExifIFD]  SubSecTimeDigitized             : 498
[Composite]     SubSecCreateDate                : 2018:06:07 12:50:13.498
[Composite]     SubSecDateTimeOriginal          : 2018:06:07 12:50:13.498
[Composite]     SubSecModifyDate                : 2018:06:07 12:50:13.498


mp4:
[File:System]   FileModifyDate                  : 2018:06:07 12:58:31-06:00
[File:System]   FileAccessDate                  : 2018:06:07 13:33:18-06:00
[File:System]   FileInodeChangeDate             : 2018:06:07 12:59:13-06:00
[QuickTime]     CreateDate                      : 2018:06:07 06:50:22-06:00
[QuickTime]     ModifyDate                      : 2018:06:07 06:50:22-06:00
[QuickTime:Track1] TrackCreateDate              : 2018:06:07 06:50:22-06:00
[QuickTime:Track1] TrackModifyDate              : 2018:06:07 06:50:22-06:00
[QuickTime:Track1] MediaCreateDate              : 2018:06:07 06:50:22-06:00
[QuickTime:Track1] MediaModifyDate              : 2018:06:07 06:50:22-06:00
[QuickTime:Track2] TrackCreateDate              : 2018:06:07 06:50:22-06:00
[QuickTime:Track2] TrackModifyDate              : 2018:06:07 06:50:22-06:00
[QuickTime:Track2] MediaCreateDate              : 2018:06:07 06:50:22-06:00
[QuickTime:Track2] MediaModifyDate              : 2018:06:07 06:50:22-06:00
[EXIF:IFD0]     ModifyDate                      : 2018:06:07 12:50:22
[EXIF:ExifIFD]  DateTimeOriginal                : 2018:06:07 12:50:22
[EXIF:ExifIFD]  CreateDate                      : 2018:06:07 12:50:22
[MakerNotes:Panasonic] TimeStamp                : 2018:06:07 19:50:22
[EXIF:ExifIFD]  SubSecTime                      : 389
[EXIF:ExifIFD]  SubSecTimeOriginal              : 389
[EXIF:ExifIFD]  SubSecTimeDigitized             : 389
[Composite]     SubSecCreateDate                : 2018:06:07 12:50:22.389
[Composite]     SubSecDateTimeOriginal          : 2018:06:07 12:50:22.389
[Composite]     SubSecModifyDate                : 2018:06:07 12:50:22.389


Could I have some help changing my exiftool command to make it work with the ZS100?

Thanks!

Phil Harvey

You shouldn't use -api QuickTimeUTC with your Panasonic videos.

It seems that the Panasonic stores local times, while the Canon stores UTC times.  Inconsistencies like this are the exact reason for the -api QuickTimeUTC option.

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

boombass

OK, thanks for letting me know that about Panasonic cameras. When I use the command exiftool -time:all -a -G0:1 -s on the same two files, I get this output:

photo:
[File:System]   FileModifyDate                  : 2018:06:07 12:50:13-06:00
[File:System]   FileAccessDate                  : 2018:06:07 12:58:47-06:00
[File:System]   FileInodeChangeDate             : 2018:06:07 12:58:31-06:00
[EXIF:IFD0]     ModifyDate                      : 2018:06:07 12:50:13
[EXIF:ExifIFD]  DateTimeOriginal                : 2018:06:07 12:50:13
[EXIF:ExifIFD]  CreateDate                      : 2018:06:07 12:50:13
[MakerNotes:Panasonic] TimeStamp                : 2018:06:07 19:50:13
[EXIF:ExifIFD]  SubSecTime                      : 498
[EXIF:ExifIFD]  SubSecTimeOriginal              : 498
[EXIF:ExifIFD]  SubSecTimeDigitized             : 498
[Composite]     SubSecCreateDate                : 2018:06:07 12:50:13.498
[Composite]     SubSecDateTimeOriginal          : 2018:06:07 12:50:13.498
[Composite]     SubSecModifyDate                : 2018:06:07 12:50:13.498


mp4:
[File:System]   FileModifyDate                  : 2018:06:07 12:58:31-06:00
[File:System]   FileAccessDate                  : 2018:06:07 12:58:56-06:00
[File:System]   FileInodeChangeDate             : 2018:06:07 12:58:31-06:00
[QuickTime]     CreateDate                      : 2018:06:07 12:50:22
[QuickTime]     ModifyDate                      : 2018:06:07 12:50:22
[QuickTime:Track1] TrackCreateDate              : 2018:06:07 12:50:22
[QuickTime:Track1] TrackModifyDate              : 2018:06:07 12:50:22
[QuickTime:Track1] MediaCreateDate              : 2018:06:07 12:50:22
[QuickTime:Track1] MediaModifyDate              : 2018:06:07 12:50:22
[QuickTime:Track2] TrackCreateDate              : 2018:06:07 12:50:22
[QuickTime:Track2] TrackModifyDate              : 2018:06:07 12:50:22
[QuickTime:Track2] MediaCreateDate              : 2018:06:07 12:50:22
[QuickTime:Track2] MediaModifyDate              : 2018:06:07 12:50:22
[EXIF:IFD0]     ModifyDate                      : 2018:06:07 12:50:22
[EXIF:ExifIFD]  DateTimeOriginal                : 2018:06:07 12:50:22
[EXIF:ExifIFD]  CreateDate                      : 2018:06:07 12:50:22
[MakerNotes:Panasonic] TimeStamp                : 2018:06:07 19:50:22
[EXIF:ExifIFD]  SubSecTime                      : 389
[EXIF:ExifIFD]  SubSecTimeOriginal              : 389
[EXIF:ExifIFD]  SubSecTimeDigitized             : 389
[Composite]     SubSecCreateDate                : 2018:06:07 12:50:22.389
[Composite]     SubSecDateTimeOriginal          : 2018:06:07 12:50:22.389
[Composite]     SubSecModifyDate                : 2018:06:07 12:50:22.389


I can't see anywhere in the video file that shows a time of 6:50 am, which is what Google Photos displays and uses to sort the video. Google Photos is really nice for organizing and displaying my pictures and videos, but at the same time really frustrating because of this bug.

Any ideas what I can do to make the videos sort correctly?

Phil Harvey

Quote from: boombass on June 08, 2018, 12:22:04 PM
I can't see anywhere in the video file that shows a time of 6:50 am, which is what Google Photos displays and uses to sort the video.

???  But you saw 6:50 am when you add -api QuickTimeUTC

QuoteGoogle Photos is really nice for organizing and displaying my pictures and videos, but at the same time really frustrating because of this bug.

This isn't a bug in Google Photos.  It is an inconsistency in the way QuickTime date/time tags are stored.

QuoteAny ideas what I can do to make the videos sort correctly?

Apparently, google photos assumes the times are UTC.  So you could use ExifTool to do this (assuming your Panasonic videos were all shot in the -06:00 time zone, and that they are MP4 format):

exiftool -if "$make =~ /panasonic/i" -time:all+=6 -ext mp4 DIR

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

boombass

OK! That did the trick! Thank you very much!

The -if "$make =~ /panasonic/i" portion of your command did not work and returned this:
    1 directories scanned
    3 files failed condition
    0 image files read


I changed the command to exiftool -time:all+=6 -ext mp4 DIR and got this output:
[File:System]   FileModifyDate                  : 2018:06:08 11:04:54-06:00
[File:System]   FileAccessDate                  : 2018:06:08 11:11:19-06:00
[File:System]   FileInodeChangeDate             : 2018:06:08 11:04:54-06:00
[QuickTime]     CreateDate                      : 2018:06:07 18:50:22
[QuickTime]     ModifyDate                      : 2018:06:07 18:50:22
[QuickTime:Track1] TrackCreateDate              : 2018:06:07 18:50:22
[QuickTime:Track1] TrackModifyDate              : 2018:06:07 18:50:22
[QuickTime:Track1] MediaCreateDate              : 2018:06:07 18:50:22
[QuickTime:Track1] MediaModifyDate              : 2018:06:07 18:50:22
[QuickTime:Track2] TrackCreateDate              : 2018:06:07 18:50:22
[QuickTime:Track2] TrackModifyDate              : 2018:06:07 18:50:22
[QuickTime:Track2] MediaCreateDate              : 2018:06:07 18:50:22
[QuickTime:Track2] MediaModifyDate              : 2018:06:07 18:50:22
[EXIF:IFD0]     ModifyDate                      : 2018:06:07 12:50:22
[EXIF:ExifIFD]  DateTimeOriginal                : 2018:06:07 12:50:22
[EXIF:ExifIFD]  CreateDate                      : 2018:06:07 12:50:22
[MakerNotes:Panasonic] TimeStamp                : 2018:06:07 19:50:22
[EXIF:ExifIFD]  SubSecTime                      : 389
[EXIF:ExifIFD]  SubSecTimeOriginal              : 389
[EXIF:ExifIFD]  SubSecTimeDigitized             : 389
[XMP:XMP-iptcExt] ArtworkCircaDateCreated       : 6
[Composite]     SubSecCreateDate                : 2018:06:07 12:50:22.389
[Composite]     SubSecDateTimeOriginal          : 2018:06:07 12:50:22.389
[Composite]     SubSecModifyDate                : 2018:06:07 12:50:22.389


It changed all of the [QuickTime] tags, but none of the other time tags. But it worked - and led to two more questions:

  • I will have to change the value of -time:all+=6 when daylight saving time changes, correct?
  • Are there any consequences of changing the [QuickTime] tags in this way? Anything to worry about in the future?
Thanks again for your help, I appreciate it greatly!

Phil Harvey

Quote from: boombass on June 08, 2018, 01:35:33 PM
The -if "$make =~ /panasonic/i" portion of your command did not work and returned this:
    1 directories scanned
    3 files failed condition
    0 image files read

OK, so it looks like your camera doesn't write a Make tag in MP4.  Most of my Panasonic MP4 have a Make tag, but there are some that don't.

Quote]I will have to change the value of -time:all+=6 when daylight saving time changes, correct?

Yes.

QuoteAre there any consequences of changing the [QuickTime] tags in this way? Anything to worry about in the future?

I can't think of any problems that this would create, other than things like the sorting order problems that you already have (if other software handles the dates differently).

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