Automatically take insv (insp) files from google drive and convert them to 360 mp4 (jpg) and upload to google photos
I have a insta360 one X, and I record with it very often, I got full 128GB insv (insp) files almost every trip.
- To convert 128GB files to mp4 means I need ~128x2 = 256GB free on my mac which is sometimes too much.
- Using the official 360Studio software to convert them will cost high CPU usage, almost can't do other things.
- I'll have to upload them to google photos to enjoy the 360 experience in cardboard or on my phone/mac, but using the google photos web UI is a terrible experience.
- You know what
python3
anddocker
are and how to run them. - You have
enough space
for your google drive and photos (Gsuite for biz for education). - You have a cloud linux machine which can run
docker
(or a spare mac to run it 24/7), ex: AWS EC2, Google cloud instance...
-
Clone this project to your instance that runs the
docker
or (download the zip) -
Due to security and NDA issues, you have 4 sub tasks to do which might take a while, but if those pain points can be eliminated, I think it's worth it.
- Follow the guide to get insta360 Media SDK (link)
- Follow the guide to get your own Google Drive service account credential. (link)
- Follow the guide to get your own Google photos OAtuh credential. (link)
- Follow the guide to setup the config files (link)
-
Check if you are ready to build the docker image
- MediaSDK folder is in this project folder insta360-auto-converter
insta360-auto-converter ├── Dockerfile ├── MediaSDK └── apps
- You followed the guide above and have the metadata folder somewhere else, ex: /Users/wmou/Documents/insta360-auto-converter-data, please keep in mind that files in this folder are confidential to you,
DO NOT SHARE WITH OTHERS!
insta360-auto-converter-data ├── auto-conversion.json ├── configs.txt └── gphotos_auth.json
-
Build the docker image under the folder which contains the Dockerfile, the last "." is required.
$ sudo docker build -t insta360-auto-converter .
- run the docker image as container
please note that the folder you mount with
-v
should be your own metadata folder.
$ sudo docker run -d -v /Users/wmou/Documents/insta360-auto-converter-data:/insta360-auto-converter-data insta360-auto-converter
- In the google drive setup sub task, you should have a working folder, then upload a folder under that working folder, which contains your insv (insp) files.
- Then this auto-converter will automatically upload the mp4 (jpg) to the Album of your google photos as the same name as the subfolder you uploaded.
- for example, "inst360_autoflow" is my working folder, then sub folder will be “測試1_360raw", and contains with many insv, insp files.
- You can run multiple docker containers on different instance for the same google account, there's a task management based on flag-files on google drive, so N docker containers are less likely getting the same insta file to work. (There's still a chance but only wasting some computing power for the cheap task management implementation.)
- Nov. 25, 2020
- fix on stall of video conversion, some error handling added
- using resumable upload to google photos, >2GB files now supported
- HDR photos can not be merged in the MediaSDK until they support it, so some of photos will not be stabilized.