Skip to content

Single-lens X4/X5 .insp export: MediaSDK produces no output (reproducible across multiple configurations) #70

@bcaldwell85

Description

@bcaldwell85

We are integrating Desktop-MediaSDK-Cpp in a backend processing worker and are consistently unable to export single-lens .insp photos from an X4/X5 using the MediaSDK. The same files export correctly (non-fisheye JPEG) via Insta360 Studio GUI.

Summary

  • Dual-lens .insp exports work correctly via MediaSDK.

  • Single-lens .insp consistently produces no output file.

  • The failure reproduces across multiple configuration combinations (including minimal flags).

  • The process does not throw an SDK-level error — it simply does not create the expected output.

Environment

SDK: 3.1.1-20250922

OS: Ubuntu 22.04

Runtime: CUDA 12.1.1 container

Camera: Insta360 X4/X5

Input type: Single-lens .insp

Reproduction Matrix

For .insp inputs, we attempt MediaSDK export using the following sequence:

  1. Full configuration
    -stitch_type (aistitch | optflow | dynamicstitch | template)
    -export_jpeg360

Result: No JPEG output created.

  1. Same configuration without CUDA

Identical to #1, but with -enable_cuda removed.

Result: No JPEG output created.

  1. Minimal stitch configuration
    -stitch_type optflow
    -export_jpeg360

Result: No JPEG output created.

  1. No explicit stitch type
    -export_jpeg360

Omitting -stitch_type entirely (SDK default behavior).

Result: No JPEG output created.

Sample Logs

2026-02-28 02:10:10,926 ERROR 34 common.drainer - Job failed job_id=3fbe54a1-ad78-4ada-b905-b317c0255fea: Expected output not created: /tmp/insta360/tmp8o52_pk8/out/IMG_20260224_145418_00_016_native.jpg
Traceback (most recent call last):
File "/app/common/drainer.py", line 382, in _process_message
result = self.process_job(job)
File "/app/insta360_worker/tasks.py", line 109, in process_job
produced = run_mediasdk(local_in, out_dir, kind)
File "/app/app/main.py", line 644, in run_mediasdk
raise RuntimeError(f"Expected output not created: {out_file}")

2026-03-02 00:21:04,478 WARNING 34 insta360.worker - MediaSDK INSP attempt 1 returned success but did not produce expected output
2026-03-02 00:21:04,526 WARNING 34 insta360.worker - MediaSDK INSP attempt 2 returned success but did not produce expected output
2026-03-02 00:21:04,573 WARNING 34 insta360.worker - MediaSDK INSP attempt 3 returned success but did not produce expected output
2026-03-02 00:21:04,619 WARNING 34 insta360.worker - MediaSDK INSP attempt 4 returned success but did not produce expected output

The retrieved output is a corrupt jpg

Fallback Behavior

If all MediaSDK attempts fail to produce output, we fall back to a Python-based dewarp pipeline:

  • Open .insp via Pillow

  • Apply fisheye → rectilinear remap using OpenCV

  • fisheye_fov

  • output_fov

  • calibrated remap matrix

  • Save {image}_native.jpg with configured jpeg_quality

This fallback path works reliably, but it is not equivalent to Studio output and bypasses MediaSDK entirely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions