Google Photos upload via API automatically deleting certain videos after processing

I wrote a basic tool to upload media to Google Photos via the official API:

Everything in the described flow works, I'm able to upload media and create the media item in Google Photos.

I receive a photoURL containing the processing video. However, a short while after the video processes the URL starts returning a 404 and the upload is gone from the Photos Library.

This doesn't happen with all videos - An arbitrary MP4 and MOV tested work just fine, but various media from a GoPro camera (MP4 in 4K) fails consistently.

1 answer

  • answered 2020-08-07 14:30 VC.One

    "but various media from a GoPro camera (MP4 in 4K) fails consistently."

    Unconfirmed but most likely it's failing because Go-Pro uses H.265 codec (aka HEVC) for 4K recordings but Google Photos supports/expects 4K to be in H.264 codec.

    • Use a tool like MediaInfo to check if the failing video is really H265/HEVC.

    • Using your video editor (or a free tool like FFmpeg) to extract a few seconds and re-encode to H.264 (in an MP4 container). Test uploading this new encoding.