Extract GPS from Sony A7iii MP4 & add Quicktime GPS tags & Adobe XMP GPS tags?

Started by lukemp4gps, November 12, 2020, 03:16:54 PM

Previous topic - Next topic

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Quote from: lukemp4gps on November 25, 2020, 11:45:00 AM
It also creates a new file called C0001.MP4_original. If I rename this extension to MP4 it also does not have exif data visible in Bridge.

As Phil says, that's the original file. It's not EXIF data.  The only thing that would change might be the system time stamps or Mac xattr metadata.

What exactly are you seeing that is missing.  Use exiftool to verify and compare to the other program you are using.
* 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).

lukemp4gps

Quote from: StarGeek on November 25, 2020, 12:28:41 PM
What exactly are you seeing that is missing.  Use exiftool to verify and compare to the other program you are using.

Using the command exiftool C0001.MP4 on the original file and after running the command some things change.

This is moved to the bottom:
Media Data Size                 : 25165632
Media Data Offset               : 192


This is added:

GPS Coordinates                 : 41 deg 29' 19.67" N, 81 deg 33' 34.31" E, 81 m Above Sea Level
Media Data Size                 : 25165632
Media Data Offset               : 5289
GPS Altitude                    : 81 m
GPS Altitude Ref                : Above Sea Level
GPS Latitude                    : 41 deg 29' 19.67" N
GPS Longitude                   : 81 deg 33' 34.31" E
GPS Position                    : 41 deg 29' 19.67" N, 81 deg 33' 34.31" E
Acquisition Record Group Name   : CameraUnitMetadataSet
Acquisition Record Group Item Name: CaptureGammaEquation
Acquisition Record Group Item Value: rec709-xvycc
Media Data Size                 : 25165632
Media Data Offset               : 5289
Image Size                      : 3840x2160
Megapixels                      : 8.3
Avg Bitrate                     : 57.4 Mbps
GPS Altitude                    : 81 m
GPS Altitude Ref                : Above Sea Level
GPS Latitude                    : 41 deg 29' 19.67" N
GPS Longitude                   : 81 deg 33' 34.31" E
Rotation                        : 0
GPS Position                    : 41 deg 29' 19.67" N, 81 deg 33' 34.31" E


It duplicates the Image Size, Megapixels and Avg Bitrate, the Acquisition Records among others.

Not sure if those moving to the bottom of tags, or duplication of tags are affecting the ability of Adobe Bridge to read the info.

Phil Harvey

This command you gave is quoted incorrectly and contained some typos.  Also, you are writing QuickTime:GPSCoordinates and UserData:GPSCoordinates.  Only one of these should be necessary.  Try this:

exiftool -config join_tags.config '-GPSLatitude<$XML:Latitude $XML:LatitudeRef' '-GPSLongitude<$XML:Longitude $XML:LongitudeRef' '-UserData:GPSGoordinates<$XML:Latitude $XML:LatitudeRef, $XML:Longitude $XML:LongitudeRef' C0001.MP4

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

lukemp4gps

Thanks, that worked for Bridge and the other meta data shows in Bridge. I will have to download the previous version or wait till v.11 to test Google Photos.

The original .mp4 file does not have exif DateTimeOriginal set. I would like to set it.  This was taken around 8:26am 11/13/2020 but the timestamps in the exif are as follows:
Create Date                     : 2020:11:13 13:26:08
Modify Date                     : 2020:11:13 13:26:08
Track Create Date               : 2020:11:13 13:26:08
Track Modify Date               : 2020:11:13 13:26:08
Media Create Date               : 2020:11:13 13:26:08
Media Modify Date               : 2020:11:13 13:26:08
Time Zone                       : -05:00


It is wrong for most of the values and it has a timezone that shows how off it is by. I will need to review the camera settings to set the timezone.

Strange because it has the time correct in one entry.
Creation Date Value             : 2020:11:13 08:26:08-05:00


Should mp4s have the DateTimeOriginal set? Or is that just for still images?

I will take a stab at copying that 'Creation Date Value' to the other date tags.

Thanks again for helping me out. 



Phil Harvey

See my edit of the post above.  I don't think the change in ExifTool 12.09 was the problem after all.  I think the problem is in the number of digits after the decimal point.  Google photos is sensitive to this.

DateTimeOriginal typically isn't stored in MP4 videos.  You don't need to write this.

Try using -api quicktimeutc in your commands if the camera knows about the time zone.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

lukemp4gps


StarGeek

Also note that EXIF data in a video file is non-standard and exiftool can't write it.  Make sure you're adding the -G (-groupNames) option to see the group name.  All EXIF data is metadata but not all metadata is EXIF data.

Also, as Phil said, Quicktime:DateTimeOriginal isn't typically added to most videos and if written incorrectly, will cause problems with Apple Photos app.

And some of that "added" data are Composite tags, not actually embedded data.  Which is why you should use the -G# option to see this. 
* 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).

lukemp4gps

Quote from: StarGeek on June 26, 2020, 03:33:25 PM
Adobe Bridge (and other Adobe products) do not read the time stamp correctly and display the raw, unadjusted value.

You have to decide if it is more important for Finder to read the correct time or Bridge, because one or the other is going to have to be wrong.

You wrote the above in a separate thread. That seems to be the answer I have been looking for but didn't want. Unfortunate that Adobe does not read the timestamp correctly since I like the batch renaming tools in Adobe Bridge but it reads the time wrong and therefor labels the videos wrong.

Quote from: StarGeek on June 26, 2020, 03:33:25 PM
... the time stamp in video files is supposed to be set to UTC (see 4th paragraph under Quicktime tags).  Finder (and Windows) understands this and will adjust the displayed time accordingly.

Adobe Bridge (and other Adobe products) do not read the time stamp correctly and display the raw, unadjusted value.

You have to decide if it is more important for Finder to read the correct time or Bridge, because one or the other is going to have to be wrong.

Quote from: StarGeek on June 26, 2020, 03:33:25 PM
If you want to set the time correctly for Bridge, it will be a two step procedure, which, as a side effect, will set a tag read by the Apple Photo app correctly.  First, you will want to copy the adjusted time into the DateTimeOriginal tag
exiftool -api QuickTimeUTC '-Quicktime:DateTimeOriginal<Quicktime:CreateDate' /path/to/files/
Then copy the adjusted time back into the CreateDate.
exiftool '-Quicktime:CreateDate<Quicktime:DateTimeOriginal' /path/to/files/

So, if I do this two step procedure the time will be set correctly for Bridge and Apple Photos but then will be read wrong in Finder?

Since Finder and Google Photos read the timezone / UTC combo correctly, I will likely keep it that way and just ignore Adobe's non standard video time use.  I realize there is not a perfect standard for video as you stated above but seems like Adobe is more of the odd person out in this situation.

StarGeek

Quote from: lukemp4gps on November 30, 2020, 08:35:03 AM
So, if I do this two step procedure the time will be set correctly for Bridge and Apple Photos but then will be read wrong in Finder?

Test it to see, I don't recall the exact situation there.  But the Quicktime:DateTimeOriginal must include a time zone for Apple Photos to read it correctly.
* 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).

lukemp4gps

I should have done that test myself before asking.

I did the test and running those two commands, makes the date correct in Bridge but wrong in Google Photos. Since Google Photos can read the "correct" date and time straight from the camera, I am goin to keep it that way.

For this camera's video files, Finder on the Mac seems to be a mess. It only shows the file creation date and does not see the contents created date.

Bottom line is that the correct date/time info is stored in the file.  Just have to remember that Bridge doesn't see it right when batch renaming.  Not sure what's going on with Finder so will have to do more testing. Hopefully Adobe starts reading time zones but I am not holding my breath.

Thanks again.

lukemp4gps

Just installed 12.11 and tried to set the GPS for Google Photos but when I upload the test file the GPS doesn't show up in Google Photos. 

I restarted the computer to make sure that it is using the 12.11  IF it update worked for your tests, then it is something I am doing. I am going to let the video file sit in Google Photos and see if it later scans it and has the correct GPS.

Phil Harvey

Could you run this command on the file that doesn't show GPS in Google Photos?:

exiftool -G1 -a "-gps*" FILE

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

lukemp4gps

[XMP-exif]      GPS Latitude                    : 41 deg 29' 19.68" N
[XMP-exif]      GPS Longitude                   : 81 deg 33' 34.31" W
[Composite]     GPS Latitude Ref                : North
[Composite]     GPS Longitude Ref               : West
[Composite]     GPS Position                    : 41 deg 29' 19.68" N, 81 deg 33' 34.31" W


In case it's helpfull, I used the package installer to install 12.11 After I installed it, I deleted the files from the bin and then re-ran the package installer.


Phil Harvey

You need to write UserData:GPSCoordinates for Google Photos.  This file does not contain that metadata.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).