orbis-reframe Manual Camera formats Download Source code

What orbis-reframe knows about the cameras' recorded files, kept up to date with its development. On GitHub.

Insta360 X5 file format — .insv / .lrv reference

Everything this project knows about the Insta360 X5's recorded video files: the MP4 container, the video/audio streams, the proprietary inst trailer, the telemetry in it (gyro, accelerometer, exposure, GPS), and the lens calibration. It collects the findings from lib/orbis-core/, the spikes/tools, the project's development notes, a direct re-inspection of the sample footage, and a cross-check against the external sources in §13 (2026-09-24).

The other cameras' formats are in their own files next to this one, indexed in README.md; they describe how each differs from this one.

Confidence markers used below:

The main external sources are Gyroflow's telemetry-parser (src/insta360/), which has a full reader for this trailer including the protobuf schema of the metadata record; ExifTool (QuickTimeStream.pl, ProcessInsta360); BenjaminHenriksson's insv-stitch; the Insta360 X5 online manual; and the TDK ICM-40609-D datasheet. We use only interoperability documentation and our own files. No Insta360 SDK disassembly was used, and none should be.

Reference clips (sample_footage/, gitignored), all from one camera: firmware v1.5.6_build1 for the 2025 clips, v1.11.10_build1 for the 2026 ones (one clip v1.11.6_build1). Which modes they cover is in §3.4.

clip length notes
Old/VID_20250904_193105_00_002.insv (+ LRV_…_01_002.lrv) 42.8 s stick mount, GPS, main test clip
Old/VID_20250828_192900_00_001.insv ~9.5 min curves clip, two AAC streams (camera mic + Mic Air), no GPS
Old/VID_20250828_201257_00_006.insv ~10.7 min 15 GB, GPS for the first ~48 s only (§8), different rolling-shutter value
Split card original/VID_20250927_144221_00_019.insv / _020 (+ .lrv) 1799.8 s + 445.6 s one 37-minute recording split into two files, straight from the card, handlebar mount
Analysis/VID_20250927_144221_00_019-trim.insv / _020-trim 30 min + 7.4 min the same recording re-written (trimmed ~2 s at each end) by Insta360 software
Modes/VID_20260927_*_00_001…005.insv (+ .lrv) ~12 s each one clip per mode, camera still (§3.3)
ilog/VID_20261018_185907_00_006.insv 11 s 5.7K 30 I-Log, indoor
Demo/…/VID_20260815_*.insv (+ .lrv), IMG_20260815_*.insp 18 clips, 77 photos a day's ride, 8K 30: 12 video clips and 6 timelapses (_078, _079, _088, _089, _091, _095, §3.5); two Interval series of 72 MP 360 photos with GPS (§3.6)
Demo/…/card/ that day's card files other than the media: MISC/Camera01/*.pb sidecars of every clip and proxy (§9), MISC/RECRST_IDX*.SUCC, DCIM/fileinfo_list.list, DCIM/.editinfo_list.list
Modes/VID_20250905_185106_00_018.insv (+ .lrv) 24 s (726 frames) timelapse at firmware v1.5.6, 8K, 2 s interval, on the move (§3.5)
Modes/VID_20260801_172932_00_024.insv (+ .lrv) 44 s 8K 30 riding, firmware v1.11.6
Marks/VID_20261110_220445_00_010.insv (+ .lrv, .insv.pb) 24.5 s 8K 30 with two highlight marks set while recording (§4.3)

1. Files on the card

DCIM/Camera01/VID_20250904_193105_00_002.insv   full-res dual-fisheye master
DCIM/Camera01/LRV_20250904_193105_01_002.lrv    low-res proxy of the same take
MISC/Camera01/VID_20250904_193105_00_002.insv.pb   protobuf sidecar (§9), one per file
MISC/Camera01/LRV_20250904_193105_01_002.lrv.pb

2. MP4 container

Both .insv and .lrv are plain ISO-BMFF / QuickTime files that FFmpeg opens without special handling. After the standard boxes, the camera appends one proprietary box. Top-level layout, as camera-written ✅:

ftyp  (28 B)   major_brand "avc1", compatible "avc1isom" (even for HEVC)
wide  (8 B)
mdat           all A/V samples
moov           track tables; udta holds a ThumbnailTIFF (~1.38 MB)
inst           Insta360 trailer, runs to EOF (12.5 MB on a 43 s clip)

3. Streams

3.1 .insv (master) ✅

index what details
0 lens 0 fisheye video HEVC Main, hvc1, 3840×3840, 29.97 fps (30000/1001), ~94 Mb/s, no B-frames, GOP 60 (keyframe every 2 s)
1 lens 1 fisheye video identical parameters to stream 0
2 audio AAC-LC, 48 kHz stereo, ~189 kb/s, default
3 (only with an external mic) a second AAC-LC 48 kHz stereo stream, not default

3.2 .lrv (proxy) ✅

index what details
0 video H.264 High, avc1, 1664×832, 29.97 fps, ~4 Mb/s, B-frames, GOP 30
1 audio AAC-LC 48 kHz stereo

3.3 Capture modes ✅

The camera app (firmware v1.11.10) offers these 360 video modes:

Resolution Frame rates HDR
8K 30 / 25 / 24 on or off (off adds an "AdaptiveTone" on/off)
5.7K+ 30 / 25 / 24 on or off
5.7K 60 / 50 / 48 / 30 / 25 / 24 available at every rate
4K 120 / 100, and 60 / 50 / 48 / 30 / 25 / 24 not at 120 / 100; available at 60 and below

Measured from sample_footage/Modes/ (2026-09-27, one clip per mode):

Clip Mode Per lens fps Mb/s per lens GOP
102745_00_001 8K HDR 3840×3840 29.97 ~94 60 (2 s)
102815_00_002 8K, HDR off 3840×3840 29.97 ~94 60 (2 s)
102900_00_003 5.7K 60 HDR 2880×2880 59.94 ~104 120 (2 s)
102925_00_004 4K 120 1920×1920 119.88 ~94 120 (1 s)
104454_00_005 5.7K+ 30 HDR 2880×2880 29.97 ~63 60 (2 s)
185907_00_006 (sample_footage/ilog/, 2026-10-18) 5.7K 30 I-Log 2880×2880 29.97 ~56 60 (2 s)

3.4 Every mode, and our clips of it

All the modes the X5 offers 📖 (Insta360's shooting specs, §13), with the clips we have (the reference clips at the top; every one H.265 at 29.97 / 59.94 / 119.88 fps) and whether that is enough. Enough means the file is examined here and what the app reads per mode (lens size, calibration, IMU, exposure timing, field 25) is checked on it; one clip means examined, but a second take would check what one still clip can't (a moving camera for stabilization, another frame rate); wanted means no clip yet.

Mode Spec Files Our clips Status
360 Video 8K, HDR on / off 30 / 25 / 24 VID_…_00_ .insv + .lrv 20 at 30 fps, still and moving, one split recording; firmware v1.5.6, v1.11.6, v1.11.10 enough at 30; 25 / 24 wanted
360 Video 5.7K+ 30 / 25 / 24 as above one still clip at 30 one clip
360 Video 5.7K 60 / 50 / 48 / 30 / 25 / 24 as above one still clip at 60 one clip; 50 / 48 / 24 wanted
360 Video 4K 120 / 100 / 60 / 50 / 48 / 30 / 25 / 24 as above one still clip at 120 one clip; 100 / 60 / 30 wanted
I-Log (5.7K 60 and below) as above one indoor clip, 5.7K 30 one clip; moving, at 60 wanted
Filters Vivid / Flat as above none wanted, low: probably baked into the picture
H.264 encoding as above none wanted: every clip we have is H.265
PureVideo 8K / 5.7K / 4K, 30 / 25 / 24 ❓ none wanted
InstaFrame 2.0 360 5.7K+ + flat 4K / 1080p, 30 / 25 / 24 .insv (360) + .mp4 (flat) none wanted
Timelapse not in the spec table as video, no audio, no IMU but the orientation per frame (§3.5) six 8K clips at a 2 s interval, on the move (v1.11.10), one more at v1.5.6 with the same fields enough to recognise, play and stabilize; another interval and resolution wanted (does the entries' spacing follow field 25?)
TimeShift not in the spec table ❓ none wanted
Bullet Time not in the spec table ❓ none wanted
Loop Recording, Dashcam ❓ none wanted, low
Split recording (over 29 min 59 s, §1) two .insv + two .lrv one, as on the card and re-written by Insta360 software enough: field 26 confirmed on the card original, the join measured on both (§1); a recording in three files wanted (the third part's index)
Single-lens Video 4K / 2.7K 60…24, 1080p 120…24 VID_….mp4 none wanted
Single-lens FreeFrame 3840² 30…24, 2720² / 1920² 60…24 PRO_VID_….mp4 none wanted
Single-lens Me Mode 4K 30…24, 2.7K / 1080p 120…24 .insv (4K, and 50 fps and up), .mp4 (2.7K / 1080p at 30 and below) none wanted
Single-lens PureVideo .mp4 none wanted
360 Photo, Interval 72 MP, 18 MP IMG_… .insp (a JPEG, §3.6), .dng 77 Interval .insp at 72 MP, two series enough to start .insp support
360 Photo single shot, HDR, Starlapse, Burst; DNG; 18 MP none wanted
Single-lens Photo 36 MP, 9 MP .insp, .dng none wanted, low
Audio: Auto Wind Noise Reduction, Voice Focus, Stereo, 360 Audio 48 kHz AAC ❓ which ours used; one with a Mic Air too one clip of each wanted (field 121, §5.1)
Lens guards guarded and bare footage enough (§5.4)
Invisible Dive Case none wanted if a case is at hand
GPS remote 10 Hz records two clips, one losing the fix (§8) decoded and lined up with the video (§8)

The files and timing of the modes we have no clip of are a guess from the spec table: TimeShift and Bullet Time may record at other frame rates or sizes, or without IMU or an .lrv, as the timelapse does (§3.5).

3.5 Timelapse ✅

From the six Demo timelapses (8K, 2 s interval, firmware v1.11.10):

Field 26.1 isn't a reliable mode field beyond timelapse: it is 0 on the 8K, 4K 120 and 5.7K+ HDR clips, 6 (VideoHdr) on the 5.7K 60 HDR and the 5.7K I-Log clip, and 20 (past the published list) on four of the 2025 clips, split or not.

3.6 360 photos (.insp) ✅

From the 77 Demo photos, two series shot with Interval (firmware v1.11.10):

4. The inst trailer — framing

The trailer is anchored at EOF. Everything is little-endian. Implemented in lib/orbis-core/orbis-core/insta360/InsvTrailer.cpp (WalkTrailerRecords). The structure below is confirmed independently by ExifTool and telemetry-parser.

offset size field
0 6 header of the last record (see §4.2)
6 32 padding (zero)
38 4 trailer length in bytes from trailer start to EOF (u32). This is the inst box size minus its 8-byte box header.
42 4 trailer version: 3 on the X5 📖
46 32 magic, the ASCII text 8db42d694ccc418790edff439fe026bf

4.2 Records ✅ 📖

Each record is payload followed by a 6-byte header. The header comes after the payload, so you walk the records backward from EOF. The header is {format: u8, type: u8, size: u32}. Our code reads the first two bytes as one LE u16 "id", which gives type << 8 | format: 0x0300 means type 3 in format 0. format is 0 = binary, 1 = protobuf, 2 = JSON (telemetry-parser RecordFormat). So 0x101 = type 1 (Metadata) in protobuf format.

4.3 Record types

Type names are from telemetry-parser's RecordType / ExtraType 📖. Sizes are from the 42.8 s clip 193105 (1282 video frames).

hdr id type name X5 size contents status
0x0000 0 Offsets 310 locator table (§4.2) ✅
0x0101 1 Metadata (protobuf) ~4 KB serial, model, firmware, calibration, timing, IMU config… (§5) ✅
0x0200 2 Thumbnail 1 228 840 40-byte header (u32 1, u32 record size, u32 1, u32 0, u32 width, u32 height, zeros) + 1280×640 NV12, an already stitched equirectangular frame from the start of the recording (ExifTool: PreviewTIFF; other models store JPEG, H.264 or, the Antigravity A1, a flat view here). Read by ReadInsvThumbnail for the Media tab's and project library's cards ✅
0x0300 3 Gyro (IMU) 877 440 accel + gyro, ~1 kHz (§6) ✅
0x0400 4 Exposure 20 928 one per sensor frame (§7) ✅
0x0500 5 ThumbnailExt 76 800 (.insp) 320×160 NV12; photos only (§3.6) ⚠️
0x0600 6 FramePts / TimelapseTimestamp 9 832 (_078) u64 device µs per frame, plus one; timelapse only (§3.5; ExifTool: VideoTimeStamp) ✅
0x0700 7 GPS 22 790 53 B × 10 Hz, fix updated at 1 Hz (§8); only with a GPS source ✅
0x0900 9 AAAData (auto-exposure / white-balance / focus) 61 536 48 B per recorded frame (§4.4) 📖
0x0a00 10 Anchors / highlights 35 (51 with two marks) {type u8, count u32, count × u64} lists, 7 types (1,2,3,4,16,17,18). The marks set while recording are in type 1, as device µs (below); all counts 0 on clips without marks 📖 ✅
0x0b00 11 AAASimulation 342 294 267 B per recorded frame (the same on 192900 and 201257). Each block starts with the same u32 ms timestamp as type 9's; the rest is bit-packed and not decoded, with small 8-bit curves visible 📖❓
— 12–18 ExposureSecondary, Magnetic, Euler, SecGyro, Speed, TBox, Quaternions — not on the X5 samples (other models)
0x1800 24 TimelapseQuat 540 320 (_078) {f64 s, f64 w, x, y, z}, world → body, 11 per frame across the readout; timelapse only (§3.5) ✅
0x1600 22 Snapshots (shell_recognition_data in the .pb sidecar, §9: probably for recognising a lens guard) 8 306 836 four 1664×832 NV12 frames of the dual-fisheye picture from across the clip (§4.5) ✅
0x1c00 28 ? 12 793 eight 256-entry u8 tables, identity on every sample, then one 256-entry u16 tone curve (values 0-255, concave: 40 -> ~89, 120 -> ~178, 200 -> ~229) that differs slightly between clips; the rest mostly zero. One curve for the whole picture, not per lens ⚠️
0x1d00 29 ? 1 953 9-byte {u64 µs device timestamp, u8}, ~5 Hz ❓
0x3900 57 ? — only in the software-rewritten _019-trim clip, not in its card original: written by Insta360 software ❓
0x8000 128 TimeMap 862 136 (144221_019-trim) written by Insta360 software on trimmed/re-timed exports (the card original of 144221 has none). Decoded ✅: header {u32 32 (header size), u32 trimCount, u32 pairBytes, u32 frameCount, 16 B zero}, then trimCount × {f64 duration, source start, source end} (ms), then (video ms, original ms) f64 pairs, one per frame. On the sample: 1 trim, source 2002.0 → 1 799 764.6 ms, pairs (0, 2002.0), (33.37, 2035.37)…. Field 24 keeps naming the original first frame, so sync must add the source offset (§7.1). The app models a plain trim only (one cut, one offset); a map with several cuts or a varying offset is flagged in Media information. No sample of one: every TimeMap we have (the two 144221 -trim copies) is one cut at a constant offset ✅

Highlight marks (type 10) ✅ (2026-11-10, Marks/…_220445_00_010): the record is the camera's anchors (its name in the .pb sidecar, §9). Each list is u8 type, u32 count, then count little-endian u64 timestamps, with no padding. On that clip, recorded with two marks, list 1 holds 75 928 729 and 86 128 627 and the other six lists are empty (51 bytes; every clip without marks has the 35-byte record with all counts 0). The values are device µs on the clock of first_frame_timestamp (field 24, 70 062 121 here), so a mark's video time is (mark − field 24) / 1e6 s: 5.867 s and 16.067 s, which match when the marks were set. The .lrv carries the same record; the .pb sidecar doesn't hold the times. What lists 2, 3, 4 and 16-18 hold (marks made in the phone app? other kinds of highlight?) is unknown ❓. Read by orbiscore::ReadInsvHighlights; insv_trailer_dump --marks prints the lists.

ExifTool decodes types 1 (partly), 2, 3, 4, 6 and 7. Its source notes that 0x900/0xa00/0xb00 also occur on X3 / ONE RS / Ace Pro. Our parser reads types 1, 2, 3, 4, 7 and 10.

4.4 Type 9 — AAAData (48 B per frame) 📖

Layout per telemetry-parser: u32 timestamp (ms), f32 ev_target, f32 exp_time, u32 data_stat, u32 luma_struct, then 7 × u32 temperature or spare data. luma_struct packs:

On 193105: ev/exp read 0, and luma_struct = 0x02000000 gives ISO 100. The first u32 of the trailing data counts down slowly (2297, 2296, …). Its ms clock sits ~208 ms after the video device clock ❓, so don't use it for sync.

On 192900, 201257 and 193105 (2026-11-03) only three of the 12 words are ever non-zero: the timestamp, luma_struct and that slow counter (2083-3361 across the three clips; a temperature?). ev_target, exp_time, data_stat and the other six spare words are 0 on every frame. No white-balance or per-lens colour values: nothing here says how the two lenses' colour differs (§7).

4.5 Type 22 — Snapshots ✅

Four small frames of the camera's picture, stored as decoded images:

36-byte header   {u32 1, u32 record size, u32 1, u32 0, u32 3, 4 × u32 0}
4 × {
  28-byte header {u32 width 1664, u32 height 832, u32 stride 1664,
                  u16 0, u16 8112, 12 × u8 0}
  NV12           1664×832 Y, then interleaved U V at half size
}

The 3 and 8112 mean nothing we know of; they are the same on every sample. Each frame has the .lrv's layout (§3.2): both fisheyes side by side, lens 0 on the right. Measured on 192900, 201257 and 193105 (2026-11-03, each frame matched against every .lrv frame, rms 1.3-4 levels against 7-23 for the next best match): each one is a frame of its own clip, spread across the clip and not stored in time order (192900: 124, 383, 253, 512 s; 193105: 25.9, 34.1, 9.6, 42.2 s). How the camera picks them is unknown.

They show the picture as the camera's processing made it, before the video encoder. They have the same colour as our decode of the .insv: per lens and per channel within 0.7 % on all 12 frames (mean of unclipped pixels, over the whole circle and over the rim where the seam is; same range and matrix as the video). So the colour difference between the lenses (§7) is in the recording, not added by the decode.

5. Type 1 — Metadata (protobuf ExtraMetadata)

The payload is a protobuf message. telemetry-parser publishes its schema (extra_info.rs, fields 1–65) 📖. Fields above 65 are newer and unnamed there; their meanings below come from our own decoding ⚠️.

Our ParseMakerNotes() reads the first four length-delimited fields (1, 2, 3, 5) by hand. That works because they come first; field 4 (file_type) is absent on the X5.

5.1 Field map (values from 193105)

# name (telemetry-parser) X5 value notes
1 serial_number IAHEA25xxxxxxx (14 characters) ✅
2 camera_type Insta360 X5 ✅
3 fw_version v1.5.6_build1 ✅
5 offset 16-token short calibration §5.2 ✅
7 creation_time 20250904193105 recording start by the camera's clock, local: a varint holding the decimal YYYYMMDDhhmmss. ✅ The same time as the file name, on every X5 clip we have. The container's creation_time is that moment in UTC (2025-09-04T16:31:05Z; on 201257 2 h earlier, here 3 h) ⚠️ the offset is presumably the camera's time-zone setting
9 file_size 1012672185 size of the file before the trailer body (= inst box offset + 8) ✅
10 total_time 42 seconds
11 gps 3 doubles start fix: lat, lon, alt
14 gyro empty (older models: one sample)
17 original_offset = field 5 factory copy. The non-"original" variants may be adjusted for accessories (OffsetConvertState: WaterProof, DivingWater/Air, Protect, …)
18 trigger_source 2 = RemoteControl (4 = BtRemote on 192900) 📖
19 dimension {3840, 3840} per-lens stream size ✅
20 frame_rate 30 nominal
22 gamma_mode standard; I_Log in I-Log colour profile ✅ (both values seen)
24 first_frame_timestamp 2468081984 device µs of the first recorded video frame; the sync anchor (§7.1) ✅ 📖
25 rolling_shutter_time 21.244 (11.837 on 201257) frame readout time, ms. Gyroflow's frame_readout_time reads it directly ✅ 📖
26 file_group_info {type 20, index 0, identify "/DCIM/Camera01/…_019.insv", total 0} field 1 is telemetry-parser's SubMediaType: 2 on timelapses, 5 on Interval photos, otherwise not reliable (§3.5, §3.6); 20 is past the published enum (max 17). For a split recording index is non-zero on continuations (2 on _020; the proxies have 1 and 3), identify is the first file's path and total stays 0 -- the same on the card original as on the re-written copy ✅.
27 window_crop_info {src 5376×5376, dst 5312×5312} sensor crop window. dst is the focal reference: fx_video = fx · 3840/5312. Gyroflow computes fx / (dst_w / dimension_w) ✅ 📖
28 gyro_timestamp 1.6 IMU timing offset, ms. Gyroflow subtracts it from every gyro/accel time (§6.2) 📖
29 is_has_gyro_timestamp true enables field 28
30 timelapse_interval 2000 (timelapses only) the interval, in ms when field 59 is set (§3.5) 📖 ✅
31 gyro_calib 6 × f64 + u64 unix ts per-unit IMU calibration: 6 small values (−0.0069 0.0025 0.0041 −0.0055 −0.0088 0.0043), likely gyro + accel bias; ts 0. Identical on every clip. Whether they're already applied to type 3 data is unknown ❓
36 first_gps_timestamp 1757003465191 Unix ms. Not the first fix's time (that's 1757003464999 here), nor the first frame's; up to ~1 s off either on the samples, meaning unknown ❓. GPS lines up by field 98.3 (§8)
41 is_selfie 0
42 is_flowstate_online 0 in-camera FlowState off
44 resolution_size {3840, 3840}
46 cam_posture 0 CameraRotate0 (0/90/180/270) 📖
47 / 48 / 49 fov_type / distance / fov 15 = Mega / 0.6 / 56.8° (192900: 3 = Ultrawide / 1.0 / 40°) the in-camera or app default reframe view
51 gyro_type 1 = InsdevImuType40609 the IMU is a TDK ICM-40609(-D) 📖
53 offset_v2 34-token calibration §5.3
54 offset_v3 40-token MEI calibration §5.3. This is what Gyroflow uses
55 / 56 original_offset_v2/_v3 = 53 / 54
57 focus_sensor 3 = All
59 timelapse_interval_in_millisecond true (timelapses only) field 30 is in ms 📖 ✅
61 audio_mode 9 beyond the published enum
62 is_raw_gyro true type 3 holds raw integer IMU counts (§6.1) 📖
64 pts_type 2 = VideoPtsEexposureFile the video PTS derive from the exposure record, which confirms §7.1 📖
65 gyro_cfg_info {acc_range: 32, gyro_range: 2000} ±32 g, ±2000 °/s: the scale for raw counts (§6.1) 📖
93 — 42776 duration, ms
98 — {2468081984, 2510815317, 1757003465870, 1757003508603, 1282, 0, 20} first/last frame device µs, first/last frame Unix ms, frame count (= ffprobe nb_frames). Absent in the rewritten -trim clips ✅
111 / 112 — 56-token calibration full MEI with 13 distortion terms (§5.3). Probably "offset_v4 / original_offset_v4"
120 — 1 (2 on 192900) probably the number of audio tracks: 2 only on the clip with the Mic Air, matching its two AAC streams (§3.1). 1 on every other sample, .lrv included
121 — {1: 0, 2: 460} repeated, one entry per audio track (the count in field 120). Field 2 is a signed varint: +378 to +460 on the camera-mic-only clips, −121 on both entries of 192900. Meaning unknown ❓. Field 1 is 0 on every entry, so it doesn't say which track is which mic
145 — named lens-profile table per-accessory profiles bare, ProtectorA, ProtectorS, ProtectorAS, InvisibleDiveWater, InvisibleDiveAir: θ(deg)→image height(mm) polynomial + FOV each (bare 200°, protectors 195°, dive 190°). §5.4 ✅
143, 135 (=180), 146–163 — ❓

The "bare 200°" profile matches our empirical finding that the fisheye radius maps to θ ≈ 100°.

Code-comment correction: InsvTrailer.h says the extended 2_… string is "not in the 0x101 maker-notes record". It is in 0x101, as fields 53–56 and 111–112. ReadInsvExtendedCalibrationString() finds field 111 anyway, because it scans for the longest 2_ run.

5.2 Short calibration string (offset, field 5)

2  2663.208 2705.380 2687.820 0.326 -0.017 89.997   2648.963 8071.630 2687.090 -0.283 -0.065 88.577   10752 5376 1137
N  |------------ lens 0 (6 values) ------------|   |------------ lens 1 (6 values) ------------|

Not parsed any more (2026-09-26): the stitch uses only the extended MEI string (§5.3), which every X5 clip carries. The removed legacy parser read it as per lens cx cy radius tx ty tz, then rawH rawW extra, with the circles stacked vertically, plus empirical fixes: a ~90° tz "sensor clock", mirroring both lenses, and θ_ref ≈ 100°. The 90° clock and the mirror are also needed on the MEI path, so they're real coordinate conventions, not artefacts of that reading.

⚠️→📖 Better-supported reading: per lens radius cx cy yaw pitch roll, in a side-by-side 10752 (W) × 5376 (H) frame.

The trailing token (1137) is unknown.

5.3 Extended calibration strings

All start with 2_ (the lens count) and end with one trailing integer: 132096 = 0x20400, 197632 = 0x30400, 394240 = 0x60400. telemetry-parser calls this trailing token flag. Each lens block ends in w h lensType (10752 5376 113).

field name tokens per lens (telemetry-parser / insv-stitch layout)
53/55 offset_v2 34 16: radius cx cy yaw pitch roll tx ty tz + 4 poly coefficients (1.0 -0.189 0.274 -0.090) + w h type ⚠️
54/56 offset_v3 40 19: xi fx fy cx cy yaw pitch roll tx ty tz k1 k2 k3 p1 p2 w h lensType 📖, then a trailing flag
111/112 (v4?) 56 27: the full MEI model below ✅ 📖 (insv-stitch). Slightly different values (fx 4294.03 vs 4297.15), so probably a newer or refined calibration

56-token MEI layout (orbiscore::LensCalibExt, matching insv-stitch):

idx field lens 0 value notes
0 xi 2.000000 MEI mirror parameter
1–2 fx fy 4294.03 4293.86 sensor px, then · 3840/5312 (field 27)
3–4 cx cy 2703.31 2684.03 in the 10752×5376 side-by-side frame; lens 1 cx −= 5376, then · 3840/5376
5–7 yaw pitch roll 0.241 0.068 89.993 degrees (see below: also the lens↔︎IMU rotation)
8–10 tx ty tz 0 0 0; lens 1: 0.00077 0.00017 −0.0318 lens 1 is ~32 mm behind lens 0 (the stereo baseline). Sign checked on seam parallax: lens 0's centre is the one ahead along lens 0's own axis; the flipped model matches nothing
11–14 k1..k4 0.2297 1.602 −1.242 −3.170 radial
15 reserved 0
16–17 p1 p2 −0.00145 0.00040 tangential
18–21 s1..s4 … thin-prism
22–23 reserved
24–26 w h type 10752 5376 113

Per-unit variance: these values differ per camera, and X5 lenses are user-replaceable. Always read calibration per file; never hardcode it.

5.4 Lens-accessory profiles (field 145) ✅

145 {
  1 { 1: "bare"        2: 0  2: 0.03159       2: -8.415e-05   2: 2.201e-06  2: -1.284e-08 2: 0 }
  1 { 1: "ProtectorA"  2: 0  2: 0.0321906505  2: -9.37245e-05 2: 2.5248e-06 2: -1.5e-08   2: 0 }
  1 { "ProtectorS" / "ProtectorAS": same as ProtectorA }
  1 { 1: "InvisibleDiveWater" 2: 0.000238 2: 0.03112 2: 7.306e-06 2: 4.427e-07 2: -3.892e-09 2: 0 }
  1 { 1: "InvisibleDiveAir"   2: 0 2: 0.0299338566 2: 4.86874e-05 2: -6.784e-07 2: 1.2e-09 2: 0 }
  2 { 1: "bare" 2: 200.0 }  2 { "Protector*": 195.0 }  2 { "InvisibleDive*": 190.0 }
  3 { 1: "invisibleDive" 2: 2 }  3 { 1: "heat_bare" 2: 10 }  3 { 1: "heat_protector" 2: 12 }
}

6. Type 3 — IMU (gyro + accelerometer)

6.1 Encoding and scaling

The payload is a flat array of fixed-size samples, each starting with a u64 device timestamp. Value order is accel x, y, z, then gyro x, y, z ✅. ExifTool, telemetry-parser and our data all agree on that order. Ignore insv-stitch's x5_pipeline.md table, which lists gyro first, 56-byte samples, ~200 Hz and m/s²; it contradicts its own code and the files.

layout size after the timestamp when
raw counts (X5) 20 B 6 × u16, value = raw − 32768 (signed count) is_raw_gyro (field 62) true
doubles 56 B 6 × f64 LE, already in g and rad/s older models / is_raw_gyro false

6.2 Timing

6.3 Axes and IMU→camera orientation

7. Type 4 — Exposure ✅

7.1 Video ↔︎ IMU time sync ✅ 📖

first_frame_timestamp (field 24; also 98.1) is the device timestamp of the first recorded frame. On every clip it equals one exposure timestamp exactly:

clip exposure idx of frame 0 first frame − IMU[0] exposure[0] − IMU[0]
193105 (.insv and .lrv) 24 +773.5 ms −27.4 ms
201257 24 +778.4 ms −22.4 ms
192900 5 +157.3 ms −9.5 ms
144221_019-trim 23 +768.6 ms +1.1 ms

This is exactly how Gyroflow aligns Insta360 files 📖. telemetry-parser subtracts first_frame_timestamp from every gyro, accel and exposure time, then subtracts gyro_timestamp from the IMU. Field 64 (pts_type = VideoPtsEexposureFile) says the video PTS come from the exposure record.

video time of an IMU sample   t = (imu.ts − field24)·1e-6 − field28·1e-3        [s]
video frame n                 ↔ exposure[k + n],   exposure[k].ts == field24

Our code used to assume exposure[0] is frame 0 (a "−26.5 ms" offset; the real offset is +0.16 to +0.78 s). Fixed 2026-09-25: orbiscore::MakeInsvImuTrack anchors on field 24 + field 28, verified against image motion on two clips.

Trimmed files ✅ (2026-09-25): a file re-written by Insta360 software after a trim keeps field 24 = the original first frame, but its video starts later. The TimeMap record (type 128, §4.3) gives the original time of video t = 0: 2002 ms on 144221_019-trim (its video has 53 880 frames against 53 981 exposure samples after field 24's frame). Without adding it the gyro lands 2 s off, which made horizon lock tilt ~45° in corners. InsvTelemetry::time_map_offset_ms carries it (median source − video offset; speed-ramped maps aren't modelled).

Frame-clock drift + readout ✅ (measured and fixed 2026-09-25). The MP4 PTS are a nominal constant 1001/30000 s (frame 14220 of 192900 sits at exactly 474.474 s), but the camera's frame clock isn't exactly 29.97 fps. exposure[k+n].ts − field24 − n/fps grows linearly: +40 ppm on 192900, 193105 and 144221_020-trim (+10 ms at 255 s, +19 ms at 475 s), −15 ppm on 201257 (−7 ms at 475 s). On a 30-min clip that's ~70 ms. Mapping video time through n/fps (as the code does) lets the sync drift by that much. On top of that, the image content lags the frame timestamp by about half the readout (field 25 / 2: 10.6 ms at 21.244 ms, 5.9 ms on 201257), i.e. the timestamp marks the start of readout. Image-measured best lag on 8 segments / 4 clips vs drift + readout/2: mean +2 ms, sd 9 ms (each segment's own lag repeats to ~3 ms across its two halves; the spread is content-dependent — which sensor rows the tracked features sit in). Rotational shake removed (residual vs none, 8-segment mean): 35 % now → 40 % with drift → 43 % with drift + readout/2 (per-segment best lag: 48 %). orbiscore::MakeInsvImuTrack now fits the clock rate from the exposure record (least-squares slope vs n/fps) and maps video time as t·(1 + rate) + offset, the derived offset including field25/2:

gyro time of video time t = t·(1 + rate) + (field24 − imu[0].ts)·1e-6
                            + field28·1e-3 + timeMap·1e-3·(1 + rate) + field25·0.5e-3

Stabilized Lean-follow renders (16 views): rotation removed vs raw 20 % → 27 %.

Rolling shutter, both lenses ✅ (measured 2026-09-26; supersedes the per-lens model below). Per-cell lags (8×6 flow cells per view, ~570 cells mapped to lens + sensor row) show both lenses read out top to bottom over field 25, in step: row gradient ≈ field 25 on all clips (18–22 ms at 21.2 ms, 10.6–11.8 ms at 11.8 ms). Row v of either lens is captured at centre + (v/H − 0.5)·field25.

The centre row's time: half the exposure before the frame's ✅ (measured 2026-11-05; replaces field24 + field28 − 2.3 ms, which was 192900's alone). Each row is taken at the middle of its exposure, so the centre row of frame n sits at

exposure[k + n].ts + field28 − 0.5 ms − exposure[k + n].exposure_time / 2

The app's per-clip sync measurement (stitch::MeasureClipSync, image motion against the gyro) on three 4 s windows of each sample clip, fitted against the window's median exposure time and field 25: on 19 X5 clips (51 windows, exposure 0.3–10 ms, readout 11.8 and 21.2 ms) the best lag falls by 0.501 ms per ms of exposure, 0.31 ms RMS left (1.99 ms with one constant); the readout time adds nothing. The Antigravity A1 gives the same (antigravity-a1.md). Exposures over 10 ms weren't measured with motion, but the camera's own timelapse orientation (§3.5) puts each frame's centre row half its exposure before the frame's time over 0.2–33 ms. Auto exposure changes the exposure from frame to frame, so orbiscore::MakeInsvImuTrack times each frame by its own (ImuTrack::frameTimes); the per-clip fine-tune is left with ±0.3 ms.

~~Per-lens capture time** ✅ (measured 2026-09-26; supersedes the + field25/2 term above). The readout/2 term, and the "content-dependent" ±9 ms spread, came from two things. The two lenses aren't exposed at the same instant. And the renders used for the fit had their stab matrices a frame out of step: SeekTo lands on the first frame at or after trim-in, but the tools baked trimIn + i/fps. Measured with correctly paired renders: 40° views around the horizon, each view's best gyro lag from the essential-matrix inter-frame rotation, mapped to lens and sensor pixel. Lags are relative to field24 + field28:

clip readout (field 25) lens 0 lens 1 within a lens
192900 21.24 ms −7.2 ms (7 views) −0.2 ms (6) ≤ 3 ms over the sensor
201257 11.84 ms −7.4 ms (7) −4.2 ms (9) ≤ 5 ms
193105 21.24 ms (1 usable) −3.2 ms (6) ~14 ms (noisy)

Model now used: lens 0 at field24 + field28 − 7.3 ms (the stabilizer's reference time), lens 1 a third of the readout later. The stitch de-rotates lens 1 to lens 0's time (stitch::CaptureTiming). There is little per-row rolling shutter within a lens, so the per-row correction stays opt-in.

gyro time of video t (lens 0) = t·(1 + rate) + (field24 − imu[0].ts)·1e-6
                                + field28·1e-3 + timeMap·1e-3·(1 + rate) − 7.3e-3
lens 1 captured at            + field25 / 3

8. Type 7 — GPS ✅ 📖

53-byte records at 10 Hz, written only when a GPS source is connected (a GPS remote, per Insta360). Layout, identical in ExifTool, telemetry-parser and our decode:

offset type field
0 u64 Unix time, seconds (UTC). ExifTool reads it as two u32
8 u16 milliseconds
10 char A acquired / V void (void fixes carry no N/S/E/W)
11 f64 latitude, degrees
19 char N / S
20 f64 longitude, degrees
28 char E / W (ExifTool has also seen O, which it treats as west)
29 f64 speed, m/s
37 f64 track / heading, degrees
45 f64 altitude, m (telemetry-parser comment: "geoid undulation")

Records are 10 Hz, fixes 1 Hz. The X5 writes one record per 100 ms of video (430 records on the 42.8 s 193105 clip), but the fix behind them updates once a second: each fix -- timestamp and position alike -- repeats over ~10 consecutive records (9 or 11 at times). When the signal is lost the last fix keeps repeating: on 201257 the fix updates for 29 s, then one timestamp repeats over 211 records (21 s of video), one last record follows, and the record ends ~48 s into a 10:41 recording. So neither the record count nor the first-to-last time span measures the track; count distinct timestamps.

Heading -1 means the camera doesn't know the course: it writes it while standing still (speeds up to 0.37 m/s on _080, _081, _083; 47 of _080's 1222 fixes). Every other heading is 0-360.

Lining up with the video: the timestamps, by field 98.3. GPS is timed in Unix time (UTC); field 98.3 is the first frame's Unix ms on the camera's clock, so a fix's video time is fix ms - field 98.3. The record order doesn't carry the time: 201257's lone record after the lost-fix repeat sits at ~48 s of video but is stamped 206 s, and its position is ~3 km on from the last fix -- what 180 s at the speed before covers, not 22 s. Field 36 (first_gps_timestamp) is neither the first fix's time nor the first frame's (up to ~1 s off either way on the samples), so it isn't used. The first fix lands between -0.9 s and +1.4 s of video on the samples, and the record stops up to ~1.6 s before the video ends (193105). Insta360's trimmed exports have no field 98, and their GPS isn't lined up.

Field 98.3 alone leaves the GPS 0.5-2.4 s late (measured 2026-10-29): the change of the fixes' speed lines up with the IMU's acceleration along the travel only with the fixes moved that much earlier -- 193105 2.0 s, 201257 1.6 s, _083 2.4-1.9 s, _085 0.6 s, _086 0.5 s, and _080 2.0 s at the start of its 21 min, 1.5 s at the end (r 0.81-0.99 per 2 min of track). The picture agrees: _080 sets off at 44.2 s of video (frame differences on the LRV), the speed by field 98.3 at ~46.2 s, lined up at ~44.1 s. Whether it's the camera's clock (set from the phone) against GPS time, the GPS source's latency or both isn't known; it differs per clip and drifts within one ❓. camera::ReadClipTelemetry therefore lines a field-98 track up against the IMU (orbiscore::AlignGpsByAcceleration, lib/orbis-core/orbis-core/metadata/Gps.h, on orbiscore::BuildMotion's forward acceleration): the shift over each ~2 min, straight between them. A clip that stands still or keeps a steady speed (_081, _082, _084) stays on field 98.3.

ReadInsvGps (lib/orbis-core/orbis-core/insta360/InsvTrailer) decodes the record: acquired fixes, each once (the first record carrying it; the lost-fix repeat and anything out of order dropped), the hemisphere letters as signs, with field 98.3. Checked against exiftool -ee -n on 193105 (43 fixes) and _080 (1222): every value equal (ExifTool gives the speed in km/h). Insta360Reader turns it into the common orbiscore::GpsTrack in video time (heading -1 as unknown), read through camera::ReadClipTelemetry. ReadInsvTelemetry still only counts the record for the Media information panel -- records, A records, the fix rate (median step between distinct timestamps) and the track length (distinct timestamps × that step); positions stay out of it.

9. MISC/Camera01/<file>.pb sidecar ✅

The camera writes one sidecar per media file into MISC/Camera01/, named after it with .pb appended: VID_…_00_NNN.insv.pb and LRV_…_01_NNN.lrv.pb (insv-stitch's _find_pb_path names the first 📖). Read from the 36 sidecars of the Demo day (Demo/…/card/, firmware v1.11.10, 5.9-6.0 KB each), a protobuf with:

We don't need it: everything in it is in the file's own trailer, which a copy without MISC/ still has. It doesn't contain the IMU→camera rotation.

10. Geometry cheat-sheet (X5)

11. Tools

tool use
build/insv_trailer_dump <file> serial, model, firmware, Parameters, IMU/exposure summary; --imu / --exposure / --gps dumps
exiftool -ee -G3 <file> independent decode of types 1 (partly), 2, 3 (first 20 000, /1000 scaling), 4, 7
Gyroflow telemetry-parser (gyro2bb, or the Python telemetry_parser) full metadata JSON (Extra metadata), correctly scaled and synced IMU, Insta360 lens profile
ffprobe -show_streams container and streams (§3)
tools/residual_stab --diagnose IMU spectra, image-vs-gyro sweep, sync (block [5])

12. Open questions (after the 2026-09-24 research)

Resolved by the research: the record-type names, the type-9 layout, the meaning of most metadata fields, the IMU scale/range, the IMU part, the sync anchor, the rolling-shutter source, the sidecar path, and the file-split rule.

Still open:

  1. IMU→camera rotation for 360 reprojection. Gyroflow's yzX + lens rotation is a starting point, but insv-stitch still needed a per-unit solved matrix. Re-measure the ~50° axis discrepancy (§6.3) now that the sync anchor is fixed, and after fixing the gyro scale (§6.1).
  2. Is gyro_calib (field 31) already applied to the type-3 data, and what are its 6 values (gyro bias + accel bias?).
  3. Short-string field order (§5.2): the radius cx cy reading is likely but unconfirmed. Unused by the app since 2026-09-26.
  4. Unknown record types 11 (layout), 22, 28, 29, 57, and metadata fields 98+ other than those listed.
  5. What sets field 25 per mode (resolution / frame rate / sensor mode). 8K (HDR on/off), 5.7K+, 5.7K 60 and 4K 120 are now covered (§3.3); the other modes and rates are in §3.4.
  6. X5 I-Log's transfer curve (§3.3; bit depth and tagging are known now). Not needed while the maker's LUT does the conversion.

13. External sources