{"id":19442959,"url":"https://github.com/syncom/insta360-cli-utils","last_synced_at":"2025-02-25T07:45:34.574Z","repository":{"id":241187834,"uuid":"795734783","full_name":"syncom/insta360-cli-utils","owner":"syncom","description":"Automate Insta360 360-degree video processing tasks, no GUI","archived":false,"fork":false,"pushed_at":"2024-05-22T21:34:10.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-22T22:37:33.718Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/syncom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-03T23:20:11.000Z","updated_at":"2024-05-22T22:37:41.357Z","dependencies_parsed_at":"2024-05-22T22:47:41.664Z","dependency_job_id":null,"html_url":"https://github.com/syncom/insta360-cli-utils","commit_stats":null,"previous_names":["syncom/insta360-cli-utils"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syncom%2Finsta360-cli-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syncom%2Finsta360-cli-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syncom%2Finsta360-cli-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syncom%2Finsta360-cli-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syncom","download_url":"https://codeload.github.com/syncom/insta360-cli-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240627065,"owners_count":19831592,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T15:41:33.073Z","updated_at":"2025-02-25T07:45:34.529Z","avatar_url":"https://github.com/syncom.png","language":"Shell","readme":"# Insta360 360-degree video processing in command-line\n\nThis repository contains the utility and instructions to process\nInsta360 360-degree videos (with extension `.insv`) from the command line,\nwithout using the [Insta360\nStudio](https://www.insta360.com/download/insta360-x3) (Insta360's desktop\nediting software).\n\nIf you are a Linux user, this utility can come in handy, because as of early\n2025, Insta360 Studio has not shipped a Linux version.  \n\n## Prerequisites\n\n- A machine that runs Docker\n- Enough free space on your local file system to store original and processed\n  video files\n- [Fill out the application](https://www.insta360.com/sdk/home), get approved,\n  and download the Insta360 media SDK for Linux\n  - The latest media SDK I have access to is `LinuxSDK20241128.zip`. It contains\n    a pre-built package `libMediaSDK-dev_2.0-6_amd64_ubuntu18.04.deb` for Ubuntu\n    18.04, which is the only file I need from the zip\n\n## My workflow for converting and joining 360-degree videos\n\n1. Clone this repo.\n\n   ```bash\n   git clone https://github.com/syncom/insta360-cli-utils.git\n   ```\n\n2. Extract the aforementioned `.deb` file from the media SDK zip, and put it\n   under the directory root of the just cloned repository.\n\n3. Build the Docker container image in which the SDK is installed.\n\n   ```bash\n   # Under repo's directory root\n   docker build --tag ubuntu:insta360 .\n   ```\n\n4. Run the container, mounting host directory `datadir/` to the container's path\n   `/root/`, for host-container data sharing.\n\n   ```bash\n   docker run -v \"$(pwd)/datadir\":/root/datadir -it ubuntu:insta360\n   ```\n\n   Copy/move `.insv` files to \"$(pwd)/datadir\" on host, for processing in the\n   container.\n\n5. Inside the Docker container, in shell prompt\n\n   ```bash\n   MERGED_VIDEO=\"merged.mp4\"\n   MERGED_VIDEO_360=\"merged360.mp4\"\n\n   # Change to the host-mapped data directory in container\n   cd datadir/\n\n   # Convert to MP4, for 4K and lower resolution videos\n   for i in *.insv; do \\\n     MediaSDKTest -inputs \"$i\" -output \"${i}.mp4\" \\\n     -enable_directionlock -enable_flowstate -enable_denoise\n   done\n   # Join MP4 files into one (assuming file names are sorted in time order)\n   ls *.mp4 \u003e list.txt\n   sed -i.bak 's/^/file /g' list.txt\n   ffmpeg -safe 0 -f concat -i list.txt -vcodec copy -acodec copy \"$MERGED_VIDEO\"\n   # Inject metadata (RDF/XML GSpherical tags)\n   exiftool -XMP-GSpherical:Spherical=\"true\" \\\n    -XMP-GSpherical:Stitched=\"true\" \\\n    -XMP-GSpherical:ProjectionType=\"equirectangular\" \\\n    -XMP-GSpherical:StereoMode=\"mono\" \\\n    -api largefilesupport=1 \\\n    \"$MERGED_VIDEO\" \\\n    -o \"$MERGED_VIDEO_360\"\n   ```\n\n   \"$MERGED_VIDEO_360\" is the merged 360-degree video that can be viewed in [VLC\n   media player](https://www.videolan.org/) or uploaded to YouTube as a 360\n   video.\n\n   For 5.7K videos, separate video files like\n   `/path/to/VID_20240528_113402_00_032.insv` and\n   `/path/to/VID_20240528_113402_10_032.insv` are generated by the camera for\n   the left-eye and right-eye views. Both files need to be supplied to the\n   `-input` argument of `MediaSDKTest`, in the aforementioned order. For\n   example,\n\n   ```bash\n   # For 5.7K video\n   MediaSDKTest \\\n     -inputs VID_20240528_113402_00_032.insv VID_20240528_113402_10_032.insv \\\n     -output \"both_eyes.mp4\" \\\n     -enable_directionlock -enable_flowstate -enable_denoise\n   ```\n\n## Utility: `join-insv`\n\nThe utility `join-insv` is available in the container to automate the above\nworkflow. Example\n\n```bash\n# For 4K and lower resolution\njoin-insv --output /path/to/merged_360video.mp4 \\\n  /path/to/input-1. insv /path/to/input-2.insv ...\n\n# For 5.7K\njoin-insv --output /path/to/merged_5.7k_360video.mp4 \\\n  /path/to/VID_20240528_113402_00_001.insv /path/to/VID_20240528_113402_10_001.insv \\\n  /path/to/VID_20240528_120003_00_002.insv /path/to/VID_20240528_120003_10_002.insv \\\n  ...\n```\n\nThe synopsis of `join-insv` is as follows.\n\n```bash\nUsage: join-insv\n    [ -H | --is_57k ]\n    [ -o | --output outfile ]\n    [ -h | --help ]\n    \u003cinfile\u003e [infiles]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyncom%2Finsta360-cli-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyncom%2Finsta360-cli-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyncom%2Finsta360-cli-utils/lists"}