Minimal self-hosted NVR: watches for camera-deposited clips, transcodes to MP4, and serves a tidy playback UI — no stream pulling, no on-host AI.
  • Python 86.8%
  • HTML 10.7%
  • Just 1.9%
  • Dockerfile 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Marvin8 a8ff10b712
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
bump: version 2026.9.6.1 → 2026.9.7.1
2026-09-07 17:57:19 +10:00
.forgejo/workflows 🔒 Harden deploy-docs token, fix container annotations, switch to CMD 2026-08-12 17:26:22 +10:00
docs 📝 Document the snapshot keep flag 2026-09-07 15:04:04 +10:00
icon 📝 docs: add icon/ folder with all icon assets 2026-05-30 08:31:12 +10:00
src/cang ♻️ Extract scrubber row resolution to lower snapshot_album complexity 2026-09-07 15:14:37 +10:00
tests 🐛 Assert on kept badge markup, not the CSS class name 2026-09-07 15:19:01 +10:00
.containerignore 🐛 fix: include README.md in container build context 2026-05-31 08:20:19 +10:00
.editorconfig 📄 document all source files, add per-file-ignores for tests 2026-07-22 17:19:10 +10:00
.gitignore Enable WAL mode, add indexes, rewrite queries, serve images by ID 2026-07-25 11:17:09 +10:00
.gitleaks.toml 🔧 add scaffolding files and config alignment 2026-07-22 17:08:51 +10:00
.pre-commit-config.yaml ⬆️ bump deps 2026-09-05 19:40:18 +10:00
AGENTS.md 📝 Document process split — cangcang + cangjian 2026-08-12 18:00:51 +10:00
AI-DECLARATION.md 📝 name marvin8 explicitly in AI-DECLARATION.md 2026-07-14 19:11:27 +10:00
CHANGELOG.md docs: update changelog for 2026.9.7.1 2026-09-07 17:57:15 +10:00
CLAUDE.md 🔧 move CLAUDE.md to AGENTS.md and symlink back to CLAUDE.md 2026-07-15 10:33:30 +10:00
compose.yaml 📝 update docs, README badge, and project URLs to forge.marvin8.zone 2026-08-04 17:06:33 +10:00
Containerfile 🔒 Harden deploy-docs token, fix container annotations, switch to CMD 2026-08-12 17:26:22 +10:00
docs_hooks.py ♻️ docs_hooks.py: remove llms-full.txt generation 2026-05-29 20:53:33 +10:00
justfile 🧱 Add micro component to calver versioning 2026-08-12 13:26:37 +10:00
LICENCE Initial project scaffold: README, LICENCE, CLAUDE.md, ROADMAP.md 2026-05-27 18:13:11 +10:00
LICENSE.md 🔧 add scaffolding files and config alignment 2026-07-22 17:08:51 +10:00
mkdocs.yml 🔧 Fix bumpversion config, remove dead redirect.js, fix template sed 2026-08-12 07:49:28 +10:00
noxfile.py ⬆️ bump deps 2026-08-24 13:52:57 +10:00
pylock.toml ⬆️ bump deps 2026-09-05 19:40:18 +10:00
pyproject.toml bump: version 2026.9.6.1 → 2026.9.7.1 2026-09-07 17:57:19 +10:00
README.md 📝 Update docs for unified journey scrubber 2026-09-05 20:36:03 +10:00
Release-Notes.md bump: version 2026.9.6.1 → 2026.9.7.1 2026-09-07 17:57:19 +10:00
Release-Notes.md.template 🐛 Fix duplicate .N suffix in Release-Notes template 2026-08-12 18:09:26 +10:00
ruff.toml 🚨 ignore PLR0917 in tests, matching existing PLR0913 ignore 2026-08-04 17:08:42 +10:00
uv.lock bump: version 2026.9.6.1 → 2026.9.7.1 2026-09-07 17:57:19 +10:00

cang

Cang (藏) — Snapshot Archiver for IP Cameras

Licence: AGPL-3.0-or-later Status: Late beta Python 3.12+ Documentation Forgejo CI pepy downloads gitleaks pysentry ty complexipy

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.