Insta360 Link 1 and 2 Controller for Linux
Rust 100%
<1%

README.md

Insta360 Link Controller for Linux #

A Rust port of the Insta360 Link / Link 2 webcam controller for Linux, preserving full feature parity with the original Free Pascal/Lazarus project.

Supported Cameras #

Camera VID:PID PTZ Modes Preview
Insta360 Link 2E1A:4C01 V4L2 AI Tracking, DeskView, Whiteboard, Overhead MJPEG / YUYV
Insta360 Link 2 2E1A:4C04 Combined V4L2 AI Tracking, DeskView, Whiteboard, Overhead MJPEG / YUYV

Features #

  • V4L2 standard controls: pan, tilt, zoom, brightness, contrast, saturation, sharpness, gain, white balance, exposure, focus, backlight compensation.
  • UVC Extension Unit controls: AI tracking, DeskView, Whiteboard, Overhead, gimbal reset, tracking framing.
  • Software presets: save and recall up to 6 camera positions.
  • CLI tool linkctl for scripting and automation.
  • GUI application insta360linkgui with device selection, D-pad PTZ, sliders, live preview, activity log, and settings persistence.

Workspace Structure #

insta360-link-rs/
├── crates/
│   ├── insta360-link/        # Core library (V4L2 + UVC XU)
│   ├── insta360-link-cli/    # Command-line tool
│   └── insta360-link-gui/    # egui/eframe GUI
├── udev/99-insta360-link.rules
└── README.md

Prerequisites #

  • Linux (tested on Debian/Ubuntu-style systems)
  • Rust toolchain (1.74 or newer)
  • For the GUI: X11 or Wayland development libraries

Building #

Build everything:

cd /workspace/cam/insta360-link-rs
cargo build --workspace

Build release binaries:

cargo build --workspace --release

The binaries will be in target/debug/ or target/release/:

  • target/debug/linkctl
  • target/debug/insta360linkgui

Testing #

Run unit tests (no camera required):

cargo test --workspace

Run linting:

cargo clippy --workspace --all-targets

Format code:

cargo fmt --all

Device Permissions #

To avoid running as root, install the udev rule:

sudo cp udev/99-insta360-link.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger

Or add your user to the video group and log out/back in:

sudo usermod -aG video $USER

CLI Usage #

List cameras:

linkctl list

Connect and show info:

linkctl -d /dev/video0 info

PTZ and modes:

linkctl -d /dev/video0 pan 3600
linkctl -d /dev/video0 tilt -1800
linkctl -d /dev/video0 move 10 0
linkctl -d /dev/video0 zoom 200
linkctl -d /dev/video0 home
linkctl -d /dev/video0 tracking on
linkctl -d /dev/video0 frame half
linkctl -d /dev/video0 deskview on
linkctl -d /dev/video0 whiteboard on
linkctl -d /dev/video0 overhead on

Image controls:

linkctl -d /dev/video0 brightness 150
linkctl -d /dev/video0 contrast 140
linkctl -d /dev/video0 wb auto
linkctl -d /dev/video0 wb 5600
linkctl -d /dev/video0 exposure auto
linkctl -d /dev/video0 exposure 500
linkctl -d /dev/video0 focus auto

Presets:

linkctl -d /dev/video0 preset save 0
linkctl -d /dev/video0 preset recall 0

Get current control values:

linkctl -d /dev/video0 get zoom
linkctl -d /dev/video0 get pan
linkctl -d /dev/video0 get brightness

Raw XU command:

linkctl -d /dev/video0 xu 3 01

Add -v for verbose logging.

GUI Usage #

insta360linkgui
  1. Select the camera from the device dropdown.
  2. Click Connect. The live preview starts automatically if the camera is free.
  3. Use the D-pad buttons to pan/tilt. Hold a button for continuous motion.
  4. Adjust zoom, image controls, exposure, focus, and modes.
  5. Save preset positions for quick recall.
  6. Toggle the preview with the Start/Stop Preview button.

Settings and presets are saved to ~/.config/Insta360Link/settings.toml.

Implementation Notes #

  • Standard V4L2 device and control operations use the v4l crate.
  • Proprietary UVC Extension Unit commands use a small custom UVCIOC_CTRL_QUERY ioctl wrapper.
  • Live preview uses raw V4L2 mmap streaming; MJPEG frames are decoded with zune-jpeg, YUYV frames are converted to RGBA in software.