gilesknap / gphotos-sync

Google Photos and Albums backup with Google Photos Library API
Apache License 2.0
2.02k stars 165 forks source link

MP4 wrong date issue - 12/31/1969 #368

Closed bamsnow closed 2 years ago

bamsnow commented 2 years ago

For MP4 files the Media Created Date shows up as 12/31/1969. Is there any automated way to bulk change the Media Created Date to the File Created Date.

The issue is after I download all files via gphotos-sync, I then automatically upload the files to Amazon Photos. But Amazon Photos sort-orders the photos and video files sorted by Media Created Date. Because of the problem above, all video files show up as 12/31/1969.

I use Amazon Photos to consolidate photos from ios devices and android devices into one central set of photos. I have a mac logged into an ios account that automatically downloads full size images taken with an iphone/ipad account, which then uploads automatically to Amazon via the Amazon Photos Mac app. I have gphoto-sync running on a linux machine, that downloads all google photos from an android-linked account, which then sends those photos to a NAS. A windows machine then uploads those files via the Amazon Photos app to the same Amazon account above, which results in one consolidated photo set for an ios user and an android user. Everything works great except for the wrong date MP4 files from gphotos-sync.

gilesknap commented 2 years ago

@bamsnow do you mean that the MP4 metadata has been changed by downloading with gphotos-sync? If you manually download the same file from Google Photos Web UI is the Create Date OK?

bamsnow commented 2 years ago

If the MP4is manually downloaded via the web GUI, the Media Created date is correct. When gphotos-sync downloads the file, the Media Created date is 12/31/1969.

gilesknap commented 2 years ago

Well that's nasty. I know that the Google Photos API messes with meta data to some extent but I did not know about this one.

My code just gets the raw files from the API and does not make any changes. The truth is that Google Photos API totally transcodes all video and makes a mess of it anyway. Sorry about that but I've been nagging Google about it for several years.

bamsnow commented 2 years ago

Does anyone know a script that can be run to set the Media Created date within a MP4 as the File Created date?

gilesknap commented 2 years ago

I've got a feeling this is the tool I used when prepping my library to load into Google. https://exiftool.org/

But that was a long time ago