Cang (藏) — Snapshot Archiver for IP Cameras
Cang (藏, cáng, roughly "tsang" with a rising tone) — Chinese for "to store / to archive". Secondary meaning: "hidden", quietly apt for security footage. The name reflects the project's philosophy: cameras do all the clever work; Cang just keeps what they send.
A lightweight snapshot archiver for IP cameras. Cameras handle motion detection and object recognition themselves, deposit snapshot images into watched folders, and Cang indexes, groups, and serves them through a clean FastAPI web UI.
Cang is split into two processes:
- cangcang — the ingest daemon that scans camera directories, indexes snapshots into SQLite, and handles retention cleanup. No network surface.
- cangjian — the FastAPI web server that serves the calendar browse, snapshot scrubber, and live views.
Both share one SQLite database and snapshot store. The split prevents web UI hangs during periodic camera scans.
Inspired by LazyNVR, written in Python.
What it does
- Watches camera directories for snapshot JPEGs deposited by cameras
- Ingests all snapshots into SQLite with motion-event metadata
- Groups consecutive motion snapshots into events using a configurable time-gap threshold (60 s)
- Applies tiered retention: motion snapshots (default 30 days), background snapshots (14 days) — both configurable
- Serves a FastAPI + Jinja2 web UI with a scrubber for browsing snapshots by day and camera
- Runs as two processes — cangcang (ingest daemon) + cangjian (web server) — or in a container pod
What it does not do
- No RTSP / live-stream pulling
- No video clip processing or storage
- No multi-user roles or cloud sync
Status
Late beta — core functionality (Dahua adapter, snapshot ingestion, event grouping, tiered retention, web UI) is working. See the documentation for installation and configuration.
Licence
Copyright (C) 2026 Marvin8
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
See LICENCE for the full text.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cang-2026.8.24.1.tar.gz.
File metadata
- Download URL: cang-2026.8.24.1.tar.gz
- Upload date:
- Size: 41.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0424f51514161e2d51049db6ae4b6a88f3b73d4bd8f517b943b36759ee274a2
|
|
| MD5 |
257a923dd96d344e4c35a1c6f698ce95
|
|
| BLAKE2b-256 |
9d1b1b07125e2de7e5fcabaef353dfc8d18e8271e406e79d54a752d1bd637c89
|
File details
Details for the file cang-2026.8.24.1-py3-none-any.whl.
File metadata
- Download URL: cang-2026.8.24.1-py3-none-any.whl
- Upload date:
- Size: 50.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d778caaca8257691f65640a91705bdd2001c235a206977cb92fef38fcc09c66
|
|
| MD5 |
1f300ad949b4abb7c2462169ae8f93b8
|
|
| BLAKE2b-256 |
5823e1ae85e304edde6c68ae23337b7e630983fd14bd0c1cb5acd808a30334fa
|