- Python 86.8%
- HTML 10.7%
- Just 1.9%
- Dockerfile 0.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
/ pr-review (push) Has been skipped
/ gitleaks (push) Successful in 11s
/ pr-review (release) Has been skipped
/ gitleaks (release) Successful in 23s
/ checks (push) Successful in 1m42s
/ publish (push) Has been skipped
/ publish-container (push) Has been skipped
/ checks (release) Successful in 1m48s
/ deploy-docs (release) Has been skipped
/ publish (release) Successful in 30s
/ deploy-docs (push) Successful in 1m24s
/ publish-container (release) Successful in 2m33s
|
||
| .forgejo/workflows | ||
| docs | ||
| icon | ||
| src/cang | ||
| tests | ||
| .containerignore | ||
| .editorconfig | ||
| .gitignore | ||
| .gitleaks.toml | ||
| .pre-commit-config.yaml | ||
| AGENTS.md | ||
| AI-DECLARATION.md | ||
| CHANGELOG.md | ||
| CLAUDE.md | ||
| compose.yaml | ||
| Containerfile | ||
| docs_hooks.py | ||
| justfile | ||
| LICENCE | ||
| LICENSE.md | ||
| mkdocs.yml | ||
| noxfile.py | ||
| pylock.toml | ||
| pyproject.toml | ||
| README.md | ||
| Release-Notes.md | ||
| Release-Notes.md.template | ||
| ruff.toml | ||
| uv.lock | ||
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), and chains per-camera events into cross-camera journeys presented as one card, played in the snapshot scrubber
- 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.