Sign inSign up

chirpiot/lens-twin

By chirpiot

•Updated 2 days ago

Twin - Lens edge video runtime. RTSP/ONVIF cameras, motion recording, WebRTC. One per camera.

Image
0

1.4K

chirpiot/lens-twin repository overview

⁠Twin — Lens edge video runtime

Twin is the on-premises component of the Lens camera stack by Chirp Wireless. One Twin runs per camera, next to it on your network. It connects to the camera over RTSP or ONVIF, records motion-zone or continuous video, streams live over WebRTC, and pairs with Lens for remote management and cloud storage.

  • Platforms: linux/amd64, linux/arm64 (x86 servers and mini PCs, Raspberry Pi 4/5, Apple-silicon Docker Desktop)
  • Cameras: RTSP (H.264/H.265), ONVIF (discovery, PTZ, presets); vendor and cloud cameras through the bundled go2rtc
  • Runs as a non-root user; the web UI listens on port 80 inside the container

⁠Quick start

docker run -d --name mycamera --restart=always \
  -p 80:80 \
  -e TWIN_USERNAME=admin \
  -e TWIN_PASSWORD='choose-a-strong-password' \
  -v $(pwd)/twin/config:/home/twin/data/config \
  -v $(pwd)/twin/recordings:/home/twin/data/recordings \
  chirpiot/lens-twin:1.0.0

Then open http://localhost/ and sign in with the credentials you set.

  1. Add your camera — enter the RTSP URL or the ONVIF address (Scan works when the container is on the camera's LAN, e.g. --network=host).
  2. Copy the Twin Key shown in the Twin UI.
  3. In Lens, choose Add Camera and paste the Twin Key. Lens gives you an API URL and a one-time token.
  4. Back in Twin, paste both into Lens Connector and save.

A fresh Twin records nothing until you enable recording in its settings.

⁠Configuration

VariablePurpose
TWIN_USERNAME / TWIN_PASSWORDFirst-start login for the web UI. Required — the Twin refuses to start without them. Changing them later in the UI is fine.
TWIN_TIMEZONETimezone for recording timestamps (defaults to the host's).
TWIN_PUBLIC_URLURL under which this Twin is reachable, if not http://<host>/.

Everything else — camera source, recording mode, motion zones, timetable — is set in the web UI and persisted in the mounted config directory. The full variable list is in the product documentation.

⁠Volumes

PathContents
/home/twin/data/configconfig.json, the Twin Key, signing keys, the paired Lens identity. Back this up.
/home/twin/data/recordingsRecorded clips. Size it for your retention.

⁠Tags

  • 1.0.0 — a specific release. Pin one of these in production.
  • 1.0, 1 — newest patch / minor of that line.
  • latest — the newest release. Fine for trying Twin out, not for a site you rely on.

Each release is also a v1.0.0 tag in the source repository; the image labels org.opencontainers.image.version and org.opencontainers.image.revision identify the build.

⁠Networking notes

ONVIF discovery uses UDP multicast, which does not cross the default Docker bridge. To scan for cameras, run the Twin with --network=host or a macvlan network; otherwise enter the camera's ONVIF address by hand. Live streaming uses WebRTC and reaches the browser directly or via the TURN relay Lens provides.

⁠License

Twin is proprietary software, all rights reserved. The image bundles open-source components; their notices are shipped at /home/twin/THIRD-PARTY-NOTICES and printed by docker run --rm chirpiot/lens-twin:1.0.0 ./main -action licenses.

Tag summary

Content type

Image

Digest

sha256:b812f5f73…

Size

121.9 MB

Last updated

2 days ago

docker pull chirpiot/lens-twin