Page 1 of 1

Exiftool, Photos.app and GMT offset for videos

PostPosted: Mon Apr 17, 2017 8:34 pm
by rpedro
I take pictures and videos with both an iPhone and a Sony camera and import them into the Photos.app in the Mac.
I do a little cleanup, delete unwanted photos and then export the original JPG files to a folder (no conversion). Pictures are automatically renamed and sorted into subfolders using Hazel and a Exiftool script.

The pictures for both devices register the correct GMT offset for date and time and Exiftool renames then perfectly.

Videos are a different story.
The iPhone register the correct GMT offset and videos are correctly renamed.
The Sony camera theoretically does it right too and when I import into the Photos.app the time is correct (in my case GMT -3) when I look at the info pane.
The Problem: When I export the original videos the metadata does not recognize the GMT offset, so the time of the videos are always 3 hours more than it should. It resets to GMT +0.

When I export the videos I don’t know which device took it unless I look at the metadata.

Is the a script or Hazel rule to identify just the videos taken with the Sony Camera and correct the GMT offset?

Re: Exiftool, Photos.app and GMT offset for videos

PostPosted: Tue Apr 18, 2017 10:25 am
by Mr_Noodle
In Hazel, you can try using a date adjustment to correct the date. You can try detecting the camera via metadata (sometimes the camera model is stored there).

Re: Exiftool, Photos.app and GMT offset for videos

PostPosted: Tue Apr 18, 2017 8:39 pm
by rpedro
Mr_Noodle wrote:In Hazel, you can try using a date adjustment to correct the date. You can try detecting the camera via metadata (sometimes the camera model is stored there).


The video metadata does not store the camera model, weird.
The pictures are fine, I can see the Sony camera model.
I'll scan through all the fields and see if I can get anything unique to the videos taken with the Sony camera.

Thanks

Re: Exiftool, Photos.app and GMT offset for videos

PostPosted: Wed Apr 19, 2017 9:14 pm
by rpedro
I found this unique tag for the Sony camera videos. It happens to be the file path of the memory card.

    Description : AVCHD: /Volumes/RPBG_SD32/PRIVATE/AVCHD/BDMV

I used this script to correct the time to GMT-3:
Code: Select all
exiftool -if '$Description eq "AVCHD: /Volumes/RPBG_SD32/PRIVATE/AVCHD/BDMV"' -globalTimeShift "-0:0:0 3:0:0" -d  %Y-%m-%d_%H%M%S  '-filename<${CreationDate;}.%e' "$1"


In case it helps someone else, what it does is look in the metadata for the Description tag and if it returns the stated value (AVCHD...), renames the file using the Creation Date -3 hours.