Help understanding Google Photos Metadata Modification

Started by twoj, June 25, 2023, 06:28:01 PM

Previous topic - Next topic

twoj

I personally hate when photos are passed through cloud systems, mms, etc, it seems everyone of them modifies or strips the metadata so that you have to recreate what had already been there for information.

A friend just shared a video that he took on his Android phone, he shared it through his Google Photo app. I downloaded it, the filename is;

20200712_171216.mp4
 
I can also confirm that it was shot 20200712 at 17h12m16s since it correlates to my photos.

Here is the metadata from the file;

PS E:\temp4> exiftool.exe -G1 -a .\20200712_171216.mp4
[ExifTool]      ExifTool Version Number         : 12.58
[System]        File Name                       : 20200712_171216.mp4
[System]        Directory                       : .
[System]        File Size                       : 6.1 MB
[System]        File Modification Date/Time     : 2023:06:07 22:36:43-04:00
[System]        File Access Date/Time           : 2023:06:24 15:55:53-04:00
[System]        File Creation Date/Time         : 2023:06:24 15:55:53-04:00
[System]        File Permissions                : -rw-rw-rw-
[File]          File Type                       : MP4
[File]          File Type Extension             : mp4
[File]          MIME Type                       : video/mp4
[QuickTime]     Major Brand                     : MP4 v2 [ISO 14496-14]
[QuickTime]     Minor Version                   : 0.0.0
[QuickTime]     Compatible Brands               : isom, mp42
[QuickTime]     Movie Header Version            : 0
[QuickTime]     Create Date                     : 2020:07:29 21:52:57
[QuickTime]     Modify Date                     : 2020:07:29 21:52:57
[QuickTime]     Time Scale                      : 15360
[QuickTime]     Duration                        : 23.27 s
[QuickTime]     Preferred Rate                  : 1
[QuickTime]     Preferred Volume                : 100.00%
[QuickTime]     Matrix Structure                : 1 0 0 0 1 0 0 0 1
[QuickTime]     Preview Time                    : 0 s
[QuickTime]     Preview Duration                : 0 s
[QuickTime]     Poster Time                     : 0 s
[QuickTime]     Selection Time                  : 0 s
[QuickTime]     Selection Duration              : 0 s
[QuickTime]     Current Time                    : 0 s
[QuickTime]     Next Track ID                   : 3
[QuickTime]     Media Data Size                 : 6114365
[QuickTime]     Media Data Offset               : 11401
[Track1]        Track Header Version            : 0
[Track1]        Track Create Date               : 2020:07:29 21:52:57
[Track1]        Track Modify Date               : 2020:07:29 21:52:57
[Track1]        Track ID                        : 1
[Track1]        Track Duration                  : 23.20 s
[Track1]        Track Layer                     : 0
[Track1]        Track Volume                    : 0.00%
[Track1]        Matrix Structure                : 1 0 0 0 1 0 0 0 1
[Track1]        Image Width                     : 480
[Track1]        Image Height                    : 640
[Track1]        Media Header Version            : 0
[Track1]        Media Create Date               : 2020:07:29 21:52:57
[Track1]        Media Modify Date               : 2020:07:29 21:52:57
[Track1]        Media Time Scale                : 15360
[Track1]        Media Duration                  : 23.20 s
[Track1]        Media Language Code             : und
[Track1]        Handler Type                    : Video Track
[Track1]        Handler Description             : ISO Media file produced by Google Inc. Created on: 07/29/2020.
[Track1]        Compressor ID                   : avc1
[Track1]        Source Image Width              : 480
[Track1]        Source Image Height             : 640
[Track1]        X Resolution                    : 72
[Track1]        Y Resolution                    : 72
[Track1]        Bit Depth                       : 24
[Track1]        Video Frame Rate                : 30
[Track1]        Graphics Mode                   : srcCopy
[Track1]        Op Color                        : 0 0 0
[Track2]        Track Header Version            : 0
[Track2]        Track Create Date               : 2020:07:29 21:52:57
[Track2]        Track Modify Date               : 2020:07:29 21:52:57
[Track2]        Track ID                        : 2
[Track2]        Track Duration                  : 23.27 s
[Track2]        Track Layer                     : 0
[Track2]        Track Volume                    : 100.00%
[Track2]        Matrix Structure                : 1 0 0 0 1 0 0 0 1
[Track2]        Media Header Version            : 0
[Track2]        Media Create Date               : 2020:07:29 21:52:57
[Track2]        Media Modify Date               : 2020:07:29 21:52:57
[Track2]        Media Time Scale                : 44100
[Track2]        Media Duration                  : 23.27 s
[Track2]        Media Language Code             : eng
[Track2]        Handler Type                    : Audio Track
[Track2]        Handler Description             : ISO Media file produced by Google Inc. Created on: 07/29/2020.
[Track2]        Audio Format                    : mp4a
[Track2]        Audio Channels                  : 2
[Track2]        Audio Bits Per Sample           : 16
[Track2]        Audio Sample Rate               : 44100
[Track2]        Balance                         : 0
[UserData]      Make                            : Samsung
[UserData]      Model                           : SM-A530W
[XMP-x]         XMP Toolkit                     : Image::ExifTool 12.58
[XMP-tiff]      Make                            : Samsung
[XMP-tiff]      Camera Model Name               : SM-A530W
[Composite]     Image Size                      : 480x640
[Composite]     Megapixels                      : 0.307
[Composite]     Avg Bitrate                     : 2.1 Mbps
[Composite]     Rotation                        : 0
PS E:\temp4>


On the Google Photos website its properly displays the Date & Time as: Sun, 5:12 PM  GMT-04:00

I used the takeout to get the file and json file, the mp4 has the exact same metadata as the takeout mp4 and the json has this;
{
  "title": "20200712_171216.mp4",
  "description": "",
  "imageViews": "4",
  "creationTime": {
    "timestamp": "1686191785",
    "formatted": "Jun 8, 2023, 2:36:25 AM UTC"
  },
  "photoTakenTime": {
    "timestamp": "1594588361",
    "formatted": "Jul 12, 2020, 9:12:41 PM UTC"

So my questions are;
1_ I assume Google Photos is modifing all the Timestamps?
2_ If so, what Timestamp are they using? Ie the timestamp when it was uploaded?
    I assume it has something to do with Handler Description             : ISO Media file produced by Google Inc. Created on: 07/29/2020.
3_ Do you think the video has been re-encoded / transcoded because of that metadata; 'ISO Media file produced by Google'

Finally, since i would need the original mp4 off the phone to compare the metadata, right now i would just like to set all the timestamps to the filename, would someone be kind to me and post what the command would be. I've been trying to wrap my brain around why Google and others are not transparent about what modifications they do and why.
thanks very much!


twoj

Delving into this more,
Some background, I used to have a Samsung S8 & S9, and then did a switch to iPhone. I know that the phone was syncing photos/videos to the cloud - specifically Google Photos. I never bothered much with it since i would transfer the originals on my phone to my computer directly, and then deleted them off the phone which should have deleted them off Google Photos, I do notice that however that i have some photos & videos left on Google Photos, which turned out well for the comparison.
I found a video that i had transferred from the Samsung to my computer,  20220523_110351.mp4 (PC Size - 492MB), on Google Photos (Online - 87MB), specifically stating that it is using 'Storage Saver' which was originally called 'High Quality'.
In the metadata from that version online i can see that a significant portion of the metadata has been stripped and it has that;
Handler Description             : ISO Media file produced by Google Inc.

It seems that it has zeroed most of the timestamps
So my working theory is that photos & videos that on phones where the 'Back Up & Sync' setting was set to 'Storage Saver' or 'High Quality', that the media was uploaded in original quality to Google Photos, at which point, Google would re-encode the video to reduce the size and at the same time would strip off or modify certain metadata on the 'new' online version.

So to answer some of my questions;
1_ Yes, if the video is getting stored in their 'Storage Saver' category, the video quality has been reduced and the timestamps seem to be zeroed out or modified, presumably to the time when the video was re-encoded by Google.
2_ This is speculation but for sure the timestamp if modified. Probably to the re-encoded date
3_ Working theory is that any video that has that 'ISO Media file produced by Google Inc' in the metadata is a video file that has been re-encoded from the original.

So maybe next question
1_ in the json file is there a place to see if the video is in the original or Storage Saver/High Quality setting?
2_ What is the default setting on Android phones in the 'Back Up & Sync' setting, is it to upload in 'Original Quality' or 'Storage Saver', maybe someone can check their phone if they have never modified this setting.

Thanks again, if someone could enlighten me more on this.

StarGeek

In my testing, Google definitely does not edit the metadata on images.  But I haven't tested videos for a while.

The video time stamps are supposed to be in UTC. You can see my standard copy/paste here. So there would be an adjustment for that, but the time stamps are days off

One thing that jumps out to me is the video dimensions.  A quick search shows that a Samsung SM-A530W should be producing a video size of 1920x1080 (or 1080x1920 in portrait), but the dimensions here 480x640, much, much smaller.  I haven't heard of a phone that lets you film in smaller dimensions, but it's not something I've looked into, so I don't know.

One thing I do know is that with images, if there isn't an embedded time stamp, most commonly EXIF:DateTimeOriginal, but Google reads a bunch of others, then Google does some Javascript (I assume) magic and grabs the file system time stamp, FileModifyDate.  So my guess would be that the uploaded file was edited, and because a lot of editors do not properly copy or fill out metadate, the edited copy did not have an embedded time stamp.  But that is just a guess.

I'm going to test some videos.  First, I'm going to upload the biggest video that I have directly from a camera.  One is a 2.9 gig MOV from my DSLR and a 3.7 gig MP4 from my phone.  Then I'll use ffmpeg to strip away all the metadata without re-encoding (direct stream copy),and upload the new copies.  I'll probably wait a few hours to give Google a chance to re-encode if that's what they do, then download the files, directly and then again with Google Takeout.  Then I'll check for any differences and report back later today.
* 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).

StarGeek

Quote from: twoj on June 26, 2023, 10:48:36 AMSo to answer some of my questions;
1_ Yes, if the video is getting stored in their 'Storage Saver' category, the video quality has been reduced and the timestamps seem to be zeroed out or modified, presumably to the time when the video was re-encoded by Google.

Yes, if "Storage Saver" is used then of course the file will get re-encoded.  It's something I've never tested because of this.  I always want the original quality.

Related to this, actual EXIF data in videos is non-standard, with every camera company shoving the data into the file in different ways.  Because of this, EXIF data cannot be copied into an edited video.  If a video from a camera or phone is missing EXIF data, it has almost certainly has been edited.

Quote3_ Working theory is that any video that has that 'ISO Media file produced by Google Inc' in the metadata is a video file that has been re-encoded from the original.

This is an almost certainty.  I took a look at some videos I downloaded from YouTube with youtube-dl, and several of them, depending upon the age, had a variation of "produced by Google" in them.  But some did not and had some Apple text in them.  I think it depends upon the codec used when uploaded.  In some youtube-dl subreddits, I got the impression that certain codecs are preferred as they don't seem to lose quality after uploading, but I never looked deeper into that.

Quote1_ in the json file is there a place to see if the video is in the original or Storage Saver/High Quality setting?

You have the json file.  You can open it up with any text editor and look at the data.  Or you can run exiftool on it with the command in FAQ #3, so you see all the data, and look through that.

I do not think that you will find anything though.

Quote2_ What is the default setting on Android phones in the 'Back Up & Sync' setting, is it to upload in 'Original Quality' or 'Storage Saver', maybe someone can check their phone if they have never modified this setting.

That is almost certain to vary by phone.
* 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).