TeleImager is Unitree's image service: a server captures video from multiple cameras (UVC, V4L2, GStreamer, RealSense, etc.) and publishes it over the network via ZeroMQ or WebRTC, while a client subscribes and decodes those streams. It powers the teleoperation video pipeline of xr_teleoperate.
✨ Features
- 📸 Multiple UVC / V4L2 / GStreamer / Intel RealSense cameras
- 📢 Publish frames over ZeroMQ PUB-SUB (high quality, LAN) and WebRTC (low latency, browser)
- 💬 Serve image-config commands over ZeroMQ REQ-REP
- 🆔 Five camera identifiers: physical path, serial number, bcd_device, vid_pid, video path
- ⚙️ Configurable resolution and frame rate
- 🚀 Efficient frame handoff via a triple ring buffer
1. 📦 Installation
TeleImager has two roles — install only what you need:
| Role | What it does | Where it runs |
|---|---|---|
| Client | Subscribes and decodes streams (teleoperation, data recording, your own CV code) | Workstation / robot host |
| Server | Captures from cameras and publishes over ZMQ/WebRTC | The robot/device the cameras are plugged into |
1.0 System prerequisite (both roles)
Both roles do JPEG encode/decode through PyTurboJPEG, a ctypes binding that loads the system library libjpeg-turbo (3.0+ required) at import. pip cannot install this native library — do it once per machine. Pick one:
Method 1 — Conda (recommended, cross-platform)
conda install -c conda-forge libjpeg-turbo
Method 2 — Homebrew (macOS)
brew install jpeg-turbo
Method 3 — Build from source (Ubuntu/Debian)
git clone https://github.com/libjpeg-turbo/libjpeg-turbo.git
cd libjpeg-turbo && mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/libjpeg-turbo ..
make -j$(nproc) && sudo make install
echo 'export LD_LIBRARY_PATH=/opt/libjpeg-turbo/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
⚠️ Do not install the PyPI package named
turbojpeg— it is a different, incompatible library. This project usesPyTurboJPEG(already pulled in bypip install teleimager). Ubuntu'ssudo apt install libturbojpegis often older than 3.0, so it's not recommended. If the library is missing, TeleImager raises a detailed install hint equivalent to the above on first import.
1.1 Environment (conda)
# Install Miniconda (skip if already installed). Use the aarch64 installer on Jetson/ARM.
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 && rm ~/miniconda3/miniconda.sh
source ~/miniconda3/bin/activate && conda init --all
# Create and activate the project environment
conda create -n teleimager python=3.10 -y
conda activate teleimager
1.2 Client install
| You need | Command |
|---|---|
Headless — subscribe ZMQ → BGR ndarray (feed your own code) |
pip install teleimager |
| + Viewer — on-screen OpenCV windows | pip install "teleimager[viewer]" |
The viewer pulls in
opencv-python.
1.3 Server install
Pick the driver(s) for your cameras, run one install command, then add certificates at the end if you use WebRTC.
1.3.1 Choose your backend (camera driver)
A backend is the capture driver TeleImager uses to talk to a camera. They're lazily loaded, so unused ones cost nothing; start from the base (V4L2 + WebRTC) and stack on what you have:
| Backend (camera driver) | pip extra | Notes |
|---|---|---|
| Base (V4L2) | [server] |
Needs v4l2-ctl: sudo apt install -y v4l-utils |
| + UVC | [uvc] |
Needs USB access — run sudo "$(which teleimager-server)" --setup-permissions once; the wheel already bundles libturbojpeg and libusb, no apt needed |
| + RealSense | [realsense] |
|
| + Everything (except GStreamer) | [all] |
Equivalent to UVC + RealSense |
| + GStreamer | no pip package | PyGObject + system plugins — see the note under this table |
type: gstreameris the one backend with no pip extra: PyGObject must match your interpreter, GStreamer comes from the system.conda install -c conda-forge pygobject # the env from 1.1 — apt's python3-gi serves the system python instead sudo apt install gir1.2-gstreamer-1.0 gir1.2-gst-plugins-base-1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-goodAdd
gstreamer1.0-libavif your pipeline decodes H.264/H.265 (avdec_h264), andgstreamer1.0-plugins-badfor hardware decoders;v4l2srcand MJPG-over-RTP need only base + good. Confirm withpython -c "import gi; gi.require_version('Gst','1.0'); from gi.repository import Gst; print(Gst.version_string())".What it is for. An ordinary USB camera is best served by V4L2 or UVC — start there. GStreamer is the way in for cameras those two cannot reach: GMSL2 / MIPI modules on embedded boards (
nvarguscamerasrcand friends), and network cameras (udpsrc, RTSP). That is why this backend takes a wholegst-launchpipeline string instead of a device path.TeleImager pulls JPEG out of the appsink — the ZMQ publisher forwards those encoded bytes untouched, and only WebRTC decodes them — so the pipeline must end in JPEG:
... ! image/jpeg ! appsink name=sink. A source that already emits JPEG (MJPG fromv4l2src, a JPEG RTP stream) needs nothing more; a raw one needsvideoconvert ! jpegenc(or a hardware encoder such asnvjpegenc) in front of the appsink.
1.3.2 Install
Pick your backend (swap the [server] below for the matching extra), then choose one of two ways to install:
# Option 1 — from source (recommended)
git clone https://github.com/unitreerobotics/teleimager.git
cd teleimager
pip install -e ".[server]" # e.g. ".[uvc]", ".[all]"
# Option 2 — from PyPI
pip install "teleimager[server]" # e.g. "teleimager[uvc]", "teleimager[all]"
1.3.3 Grant camera access (UVC only)
V4L2 works out of the box: /dev/video* gets a logind ACL. USB video class does not — its node stays root-owned, so libusb_open() on /dev/bus/usb/... fails with EACCES. Run once (it writes a udev rule and a sudoers entry, and adds you to video):
sudo "$(which teleimager-server)" --setup-permissions # $(which ...) survives sudo's secure_path
Skip it and the server says so when it starts, printing the same command. Afterwards SSH needs a reconnect and a desktop terminal a fresh login.
1.3.3 Configure TLS certificates (WebRTC only)
See the CA guide for details. Or generate a self-signed pair quickly with openssl:
# Generate a self-signed cert valid for 365 days (cert.pem / key.pem)
openssl req -x509 -newkey rsa:2048 -nodes -days 365 -keyout key.pem -out cert.pem -subj "/CN=teleimager"
Then let TeleImager find it, one of two ways:
# Option A — default config dir (recommended, same dir as the server yaml)
mkdir -p ~/.config/teleimager/
cp cert.pem key.pem ~/.config/teleimager/
# Option B — point at any path on the CLI
teleimager-server --cert /path/to/cert.pem --key /path/to/key.pem
2. 🚀 Running the Server
2.1 Discover connected cameras
Scan with the backend flags matching the cameras you have (--uvc, --v4l2, --gst, --rs — combine freely):
teleimager-server --cf --uvc --v4l2 # add --rs for RealSense, --gst for GStreamer
Example output:
[Teleimager] 🎯 Camera Finder Report
├─ UVCCamera (3 found) [type: uvc]
│ ├─ 📷 USB HDR Camera (Generic)
│ │ ├─ physical_path : /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.1/1-3.1:1.0
│ │ ├─ serial_number : 200901010001
│ │ ├─ bcdDevice : 0200 (USB device release number)
│ │ ├─ vid : pid : 1e45:2050 (VendorID : ProductID)
│ │ ├─ video_id : 0 (/dev/video0)
│ │ └─ modes (MJPG) [width x height @ fps]:
│ │ ├─ 320x240 @ [30, 60]
│ │
│ │ └─ 1920x1080 @ [30, 60]
│ ├─ 📷 Abham Image (HHWei Technology Co., Ltd.)
│ │ ├─ physical_path : /sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0
│ │ ├─ serial_number : HHW001
│ │ ├─ bcdDevice : 0200 (USB device release number)
│ │ ├─ vid : pid : 1c45:6200 (VendorID : ProductID)
│ │ ├─ video_id : 10 (/dev/video10)
│ │ └─ modes (MJPG) [width x height @ fps]:
│ │ ├─ 640x480 @ [5, 10, 15, 20, 25, 30]
│ │ ...
│ │ └─ 2688x1520 @ [5, 10, 15, 20, 25, 30]
│ └─ 📷 Cherry Dual Camera (DECXIN)
│ ├─ physical_path : /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.2/1-3.2:1.0
│ ├─ serial_number : 01.00.00
│ ├─ bcdDevice : 0217 (USB device release number)
│ ├─ vid : pid : 1bcf:2d4f (VendorID : ProductID)
│ ├─ video_id : 2 (/dev/video2)
│ └─ modes (MJPG) [width x height @ fps]:
│ ├─ 320x232 @ [10, 15, 20, 25, 30, 60, 120]
│ ├─ 640x240 @ [10, 15, 20, 25, 30, 60, 120]
│ ├─ 800x592 @ [10, 15, 20, 25, 30, 60, 120]
│ ├─ 800x600 @ [10, 15, 20, 25, 30, 60, 120]
│ ├─ 1280x480 @ [10, 15, 20, 25, 30, 60, 120]
| ...
│ └─ 3200x1296 @ [10, 15, 20, 25, 30, 60]
└─ V4L2Camera (4 found) [type: v4l2]
├─ 📷 USB HDR Camera (Generic)
│ ├─ physical_path : /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.1/1-3.1:1.0
│ ├─ serial_number : 200901010001
│ ├─ bcdDevice : 0200 (USB device release number)
│ ├─ vid : pid : 1e45:2050 (VendorID : ProductID)
│ ├─ video_id : 0 (/dev/video0)
│ └─ modes [width x height @ fps]:
│ ├─ MJPG 1920x1080 @ [60.0, 30.0]
...
│ └─ YUYV 640x480 @ [30.0]
├─ 📷 Abham Image (HHWei Technology Co., Ltd.)
│ ├─ physical_path : /sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0
│ ├─ serial_number : HHW001
│ ├─ bcdDevice : 0200 (USB device release number)
│ ├─ vid : pid : 1c45:6200 (VendorID : ProductID)
│ ├─ video_id : 10 (/dev/video10)
│ └─ modes [width x height @ fps]:
│ ├─ MJPG 2688x1520 @ [30.0, 25.0, 20.0, 15.0, 10.0, 5.0]
...
│ └─ YUYV 640x480 @ [30.0]
├─ 📷 Cherry Dual Camera (DECXIN)
│ ├─ physical_path : /sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.2/1-3.2:1.0
│ ├─ serial_number : 01.00.00
│ ├─ bcdDevice : 0217 (USB device release number)
│ ├─ vid : pid : 1bcf:2d4f (VendorID : ProductID)
│ ├─ video_id : 2 (/dev/video2)
│ └─ modes [width x height @ fps]:
│ ├─ MJPG 3200x1296 @ [60.0, 30.0, 25.0, 20.0, 15.0, 10.0]
...
│ ├─ YUYV 640x240 @ [60.0, 30.0, 25.0, 20.0, 15.0, 10.0]
│ └─ YUYV 320x232 @ [120.0, 60.0, 30.0, 25.0, 20.0, 15.0, 10.0]
└─ 📷 Intel(R) RealSense(TM) Depth Camera 435i (Intel(R) RealSense(TM) Depth Camera 435i)
├─ physical_path : /sys/devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.2/1-11.2:1.3
├─ serial_number : (none)
├─ bcdDevice : 50d0 (USB device release number)
├─ vid : pid : 8086:0b3a (VendorID : ProductID)
├─ video_id : 8 (/dev/video8)
└─ modes [width x height @ fps]:
├─ YUYV 424x240 @ [60.0, 30.0, 15.0, 6.0]
├─ YUYV 640x480 @ [30.0, 15.0, 6.0]
├─ YUYV 1280x720 @ [15.0, 10.0, 6.0]
└─ YUYV 1920x1080 @ [8.0]
2.2 Start the server
On first run the server writes a default config to ~/.config/teleimager/teleimager_server.yaml.
Edit it to match the Camera Finder Report from section 2.1, then start the service:
teleimager-server
Useful flags: --config <path> (or $TELEIMAGER_CONFIG) to point at another config; --no-affinity to skip CPU-core pinning.
2.3 Auto-start on boot
Once everything is verified, you can install it as a systemd service so it starts with the machine:
sudo "$(which teleimager-server)" --setup-service
It writes teleimager.service to /etc/systemd/system, pins it to the interpreter that ran the command and to your account (via $SUDO_USER), and enables it right away. The service reads the config you have already set up at ~/.config/teleimager/teleimager_server.yaml — edit that file, then sudo systemctl restart teleimager.service. From a root shell (sudo su -), add --user <name> since $SUDO_USER is unset there.
Manage it with systemctl status / restart / stop / disable teleimager.service, and follow its log output with journalctl -u teleimager.service -f.
3. 📺 Running the Client
3.1 Over ZMQ
With the server running, start the client on another terminal (or machine), pointing at the server's IP:
teleimager-client --host 192.168.123.164 # default: 192.168.123.164
Each camera stream opens in its own OpenCV window (requires teleimager[viewer]).
For headless subscription, follow the # public api of TeleImageClient in client.py and subscribe from your own code.
3.2 Over WebRTC
Open the server's WebRTC page in a browser and click the start button in the center of the page:
https://<host_ip>:<webrtc_port> # e.g. https://192.168.123.164:60001
4. 🧠 Design Principles
4.1 Why five camera identifiers?
With several cameras connected at once, the system needs a reliable way to tell them apart. TeleImager supports five identifiers, resolved in priority order:
physical_path > serial_number > bcd_device > vid_pid > video_id
Each has trade-offs, and manufacturers use these fields inconsistently — a field's "standard meaning" in the USB spec often differs from the value the vendor's firmware actually writes. The table below reflects real-world behavior.
| Identifier | What it is | 🎯 Strength | ⚠️ Weakness |
|---|---|---|---|
| physical_path | Kernel-assigned USB topology path — which physical port it's plugged into | Stable while the port is unchanged; independent of firmware; ideal for fixed rigs (head + wrists) | Must update config if moved to another port |
| serial_number | String in the USB descriptor, meant to be unique per unit | Portable across ports; the canonical per-unit device ID | Cheap cameras may share it, leave it empty, or malform it |
| bcd_device | BCD firmware-revision number; some vendors vary it per unit | Hardcoded in firmware, survives reboots and port changes; can act as a serial number when the vendor intends it | Often identical across all units of a model |
| vid_pid | 16-bit vendor:product IDs | Very stable; distinguishes models at a glance | Same-model units usually share one vid_pid |
video_id → /dev/videoX |
Kernel-enumerated V4L2 node number | Simplest: just fill in the number X |
Changes with plug order / reboot / enumeration — unreliable with more than one camera |
The granularity of
bcd_deviceandvid_pidis entirely up to the vendor. Always runteleimager-server --cfto see the actual values before choosing a field.
4.2 Why two transport methods?
The server serves two purposes with different latency/bandwidth needs:
- ZeroMQ PUB–SUB — transport over LAN. High-quality frames, low overhead, high throughput, low latency without sacrificing quality. Best for recording training data.
- WebRTC — real-time preview, VR teleoperation, UI debugging. Low latency with adaptive bitrate, H.264 (default) / VP8, compatible with browsers and VR devices.
4.3 Triple ring buffer benefits
- No tearing — read and write never touch the same slot, so the reader never reads a half-written frame.
- Always fresh — unlike a FIFO queue, stale frames are overwritten, so the reader always gets the newest frame. Critical for real-time use.
5. 🧐 FAQ
- Serial number / other fields show
unknownin--cfoutput? Some cameras need elevated permissions to expose full hardware metadata. Try:
sudo $(which teleimager-server) --cf --uvc
Server reports No module named 'psutil' on start?
psutil (used for optional CPU-affinity tuning) ships with teleimager[server]. If a partial install left it missing, add it with pip install psutil, or reinstall via pip install -e ".[server]". Missing it now only logs a warning and skips the optimization instead of crashing.
6. 🙏 Acknowledgement
Some code references: https://github.com/ARCLab-MIT/beavr-bot
Metadata
Release files for teleimager 2.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| teleimager-2.0.8.tar.gz | 60.1 kB | Without provenance | Details for teleimager-2.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| teleimager-2.0.8-py3-none-any.whl | Python 3 | none | any | Details for teleimager-2.0.8-py3-none-any.whl |
Total release size: 113.9 kB
Release files / teleimager-2.0.8.tar.gz
| Download URL | teleimager-2.0.8.tar.gz |
|---|---|
| Size | 60.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e701ede0298ce510df4f8daa8bd63b3241c015cd07481957f05004be7c16a74e
|
|
BLAKE2b-256 checksum How to use checksums |
9b235fa2d358a7a9cb9bdc4966f0e8f8587631302eeb741ce7b9ea5842fcaddf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.17
|
Release files / teleimager-2.0.8-py3-none-any.whl
| Download URL | teleimager-2.0.8-py3-none-any.whl |
|---|---|
| Size | 53.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d2b43e4b8254809c5ceb80abfa5374c8a5f7a05ca58c16de5a5c51be1aed29b4
|
|
BLAKE2b-256 checksum How to use checksums |
80a1b8e85772b3149571fc0ee874f9516493c3cee4f53ab3d99de8df77d109df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.17
|
Security for teleimager 2.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.