Skip to main content

360° Panorama & Video Pipeline

Leverage 360° cameras or stabilised walkthrough videos to bootstrap WebAR³ VPS maps when traditional photogrammetry is impractical.

Extract Frames

ffmpeg -i hotel-tour.mp4 -vf fps=1 tour_frames/frame_%04d.jpg
  • Use 1–2 fps for videos.
  • For panoramic cameras (Insta360, Ricoh Theta) export equirectangular JPGs.

Upload the Frame Set with Python

Zip the selected frames and trigger the feature-cluster pipeline via REST.

# cluster_frames.py
from pathlib import Path
import zipfile
import os
import requests

API_BASE = "https://was-vps.web-ar.xyz/vps/api/v3"
TOKEN = os.environ["WEBAR3_TOKEN"]
FRAMES_DIR = Path("tour_frames")
ARCHIVE = Path("tour_frames.zip")

with zipfile.ZipFile(ARCHIVE, "w", compression=zipfile.ZIP_DEFLATED) as zf:
for frame in sorted(FRAMES_DIR.glob("*.jpg")):
zf.write(frame, frame.name)

headers = {"Authorization": f"Bearer {TOKEN}"}

init = requests.post(
f"{API_BASE}/pipelines/feature-cluster/import",
json={"name": "Hotel Lobby Tour", "frameCount": len(list(FRAMES_DIR.glob('*.jpg')))},
headers=headers,
)
init.raise_for_status()
cluster_info = init.json()
upload_url = cluster_info["uploadUrl"]
cluster_id = cluster_info["clusterId"]

with ARCHIVE.open("rb") as src:
put = requests.put(upload_url, data=src, headers={"Content-Type": "application/zip"})
put.raise_for_status()

finalize = requests.post(
f"{API_BASE}/pipelines/feature-cluster/{cluster_id}/finalize",
json={},
headers=headers,
)
finalize.raise_for_status()
print(f"Feature cluster {cluster_id} ready")

The API returns clusterId, pointing to a curated frame subset stored on the server.

Convert the Cluster to a Map

import os
import requests

API_BASE = "https://was-vps.web-ar.xyz/vps/api/v3"
TOKEN = os.environ["WEBAR3_TOKEN"]
headers = {"Authorization": f"Bearer {TOKEN}"}

payload = {
"name": "Hotel Lobby Tour",
"dataType": "feature_cluster",
"clusterId": "cluster_abc123",
"publish": False
}

resp = requests.post(f"{API_BASE}/maps/import", json=payload, headers=headers)
resp.raise_for_status()
print(resp.json()["mapId"])

After processing finishes (READY status), open the route in the mobile or Web SDK and confirm that localisation remains stable along the tour.

Best Practices

  • Maintain constant walking speed and avoid sudden rotations.
  • Ensure consistent lighting; re-shoot hotspots that cause blown highlights.
  • Capture at least one full loop so the algorithm can close the trajectory.