Back to Work & Blog
PortalCamXGRIDS3DGSWorkflow 2026-07-26~8 min read

Extracting 4K Source Images
from PortalCam's Raw Data (.xbin)

This is Kou Nakamura from Locahun 3D. When you scan with PortalCam, LCC Studio and Lixel Studio export 3DGS and point clouds for you — but behind that, the original 4K images taken by the camera itself are still sitting inside the raw data, untouched. This article covers how to extract 4K source images from the raw data (.xbin) using CLI tools alone, and lays out honestly what we learned trying photogrammetry reconstruction from those extracted images.

An example 4K source image extracted from PortalCam's raw data and converted from fisheye to perspective projection (a road and high-rise buildings)
An extracted 4K source image, converted to perspective projection. Inside the raw data it's recorded as a fisheye H.264 video, so it's converted here — as-is, it isn't easy to work with in ordinary image-processing software.
Scan with PortalCam .xbin (raw data) Extract with extract_images_h264.exe 4K fisheye JPEG Convert to perspective projection

01 Why extract source images from raw data

Exporting a PortalCam scan through LCC Studio gives you 3DGS, a point cloud, and a LiDAR mesh. That covers most of what you need for video production, but there are cases where you separately want the 4K images from the camera itself, as captured while walking the site. There are two use cases 3DGS alone can't cover.

PortalCam's LCC Studio does have a GUI feature for exporting images, but this article uses a method that never opens the GUI and works entirely through CLI tools, since that's easier to fold into batch processing and automation.

02 What's inside a PortalCam scan's output

Before extraction, it helps to know what's inside the folder PortalCam creates for a single scan. Under ShotData/<scan name>/, the layout roughly looks like this.

ShotData/<scan name>/
├─ 2026-XX-XX-XXXXXX.xbin        # Raw sensor recording (images + LiDAR + IMU + GNSS)
├─ ply/ply-result/
│  ├─ point_cloud/iteration_100/point_cloud.ply   # The 3DGS itself
│  └─ cameras.json                # Dummy (only the startup.jpg entry — unusable)
├─ Lcc2/lcc2-result/              # LCC2 export (3dgs/*.sog + mesh/*.ply + info/poses.json)
├─ mesh-files/<scan name>.obj    # LiDAR mesh (coarse — tens of thousands of vertices, triangles ~20cm)
└─ project_data/
   ├─ poses.csv                  # Trajectory (ts,x,y,z,qx,qy,qz,qw)
   └─ log/project.json           # DeviceInfo.CameraList shows the camera configuration

The only thing we use here is .xbin — the heaviest file in the set. Its size scales with recording time; a scan of a few minutes lands around 1GB.

03 What xBin actually is: H.264 video, not JPEG

Running a binary analysis on .xbin reveals its real identity: an XBAG-format container (magic number "XBAG"), a "multiplexed sensor data" container similar in spirit to a ROS bag. Camera footage, LiDAR point clouds, IMU, and GNSS are all interleaved in a single file in time order.

Simple JPEG carving doesn't workScanning the entire file for JFIF/PNG signatures turns up zero embedded still images. The camera footage is recorded as an H.264 video stream, so no image can be extracted without decoding it first.

You could demux the H.264 stream yourself and hand it to ffmpeg, but that requires correctly walking the XBAG record boundaries, which is a fair amount of work. The XGRIDS-native CLI tool covered in the next section lets you skip worrying about that step entirely.

04 The command to extract 4K source images

The tool used here is extract_images_h264.exe, bundled with LixelStudio. There's no need to launch LCC Studio or Lixel Studio — it's a single command line.

"C:\Program Files (x86)\LixelStudio\extract_images_h264.exe" ^
  --hbc_path <path to .xbin> --out_dir <output directory> ^
  --out_fps 5 --prj_version 1 --device_type 4 --use_blur_detect 1
--prj_version 1 is not optionalOmit it and the tool exits silently with just "hbc not exsit" — no error message at all. Use 0 for .hbc format, 1 for .xbin format.

--device_type specifies the capture device, but PortalCam isn't listed among the documented options. After actually testing it, here's what worked.

device_typeTarget deviceResult
1Lixel L20 images
3Lixel L2 Pro0 images
4Lixel K1
(this is the value PortalCam needs)
Extraction succeeds
5 / 6(other devices)0 images

Get just these two flags right, and images/camera_0/ and images/camera_1/ appear under your --out_dir, filled with 4000×3000 (12-megapixel) fisheye JPEGs named by timestamp. Note that --out_fps effectively has no effect — every frame from the source data is output regardless.

If the fisheye distortion is a problemThe extracted images are the raw circular fisheye capture. To use them in ordinary image-processing or photogrammetry software, convert them to perspective projection with the bundled fisheye2perspective.exe. The image at the top of this article, and the figures below, are all post-conversion.

05 The constraint: only 2 of the 4 cameras come out

PortalCam's camera configuration can be checked in project_data/log/project.json under DeviceInfo.CameraList, and it's a 4-lens setup: left_main / left_seco / right_main / right_seco. Definitions for all four channels exist inside the .xbin header's binary structure as well.

In practice, though, extract_images_h264.exe only decodes left_main and right_main — two streams. We haven't yet found a way to output the seco side.

Fortunately, camera_0 and camera_1 form a synchronized stereo pair with 0ms timestamp difference, so parallax information itself is preserved.

A 4K source image extracted from the camera_0 side (after perspective conversion)
One frame from camera_0 (left_main).
A 4K source image extracted from the camera_1 side (after perspective conversion)
One frame from camera_1 (right_main).The other eye's view, recorded at the same instant.

06 Testing it: photogrammetry from the extracted images fails across the board

From here on, the conclusion comes with caveats. We wondered whether, if 4K source images could be pulled out, photogrammetry could also build a mesh from them — and tested it on a conference-room scan (82 capture points × 2 lenses = 163 images). At this point, this route is a dead end.

RealityScan hangs completelyLoaded as-is (fisheye), it crashes with a Mini Dump right at launch. Even after converting to perspective projection (2000×2000, 100° horizontal FOV) with fisheye2perspective.exe, it stalls at the Aligning Images step with 0% CPU usage. In practice: 593 seconds of CPU time consumed, then 38 minutes with zero progress, memory usage draining from 1GB down to 0.29GB, and the main window becoming unresponsive — we force-quit it. Output: zero results.
COLMAP won't even launchIt crashes immediately with 0xC0000142. The cause is Windows Smart App Control blocking an unsigned DLL (cholmod-*.dll). Since disabling Smart App Control is an irreversible operation that can only be undone by reinstalling Windows, we didn't go down that path for this test.

The underlying cause is a matter of image count and spacing. 82 capture points × 2 lenses is too sparse for feature matching to succeed. PortalCam is designed to collect 3DGS data continuously while walking, which is fundamentally at odds with the shooting style photogrammetry assumes: staying at one point and capturing with a high overlap ratio. On top of that, the conference room we tested had a lot of blank walls, meaning few distinguishable feature points to begin with. The fisheye-to-perspective conversion itself worked without issue (163 images processed in 8.2 seconds) — the bottleneck is entirely on the reconstruction side.

If we try againReproducing this on the same site would need a re-shoot with a much higher overlap ratio. Extracting the seco-side pair as well would simply double the amount of information, but for now only the main-side pair is available. For the time being, the most realistic use for the extracted images is as AI reference material, covered in the next section.

07 Where this is useful, and a summary

To sum up this article: PortalCam's raw data (.xbin) is an XBAG-format H.264 video, and passing it through extract_images_h264.exe with --prj_version 1 and --device_type 4 extracts 4K source images — that's the whole path. That said, only 2 of the 4 lenses can be output, and photogrammetry reconstruction from the extracted images alone hasn't panned out so far.

The most practical use we've found is as AI reference material. The extracted sequential frames are real photographic capture of the actual site, which makes them a strong reference for correcting background artifacts with Nano Banana Pro or Gemini, and a strong input for Higgsfield's (SeeDance) @location feature. For a fuller walkthrough of that AI production workflow, see How to generate an "aerial cut" from 3DGS.

If you have questions about handling raw data or 3DGS production, feel free to reach out.

Contact

Questions about PortalCam raw data or custom scans

If your project needs adjustments at the raw-data level — outputting source images for AI reference, or designing a scan around a specific site's shooting conditions — feel free to get in touch.

Contact us →
Credits / Production

Production credit

Kou Nakamura
Kou Nakamura
Founder, Locahun 3D / Testing & writing

Founder of Locahun 3D (LOCAHUN 3D). Researches and tests capture workflows that combine 3DGS scanning with game engines and AI.

Follow @Kou45388803 →