Lightweight NVR: watches folders, transcodes to H.264/MP4, serves a FastAPI web UI.
Project description
Cang (藏) — Minimal Python Network Video Recorder
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 NVR that does as little as possible: cameras handle motion detection and object recognition themselves, deposit video clips and snapshot images into a watched folder, and Cang transcodes, indexes, and serves them through a clean web UI grouped by day and hour.
Inspired by LazyNVR, written in Python.
What it does
- Watches
incoming/<camera>/directories for clips and snapshots deposited by cameras - Ingests all snapshot JPGs (not just those matched to clips); stores them in SQLite with motion-event metadata
- Groups consecutive motion-event snapshots into events using a configurable time-gap threshold (default: 60 seconds)
- Transcodes video clips to H.264/MP4 with
-movflags +faststart(browser-seekable) - Indexes everything in SQLite: camera, timestamp, duration, thumbnail
- Serves a FastAPI + Jinja2 web UI: day view with events as primary view, video clips in a collapsible secondary section
- Applies tiered retention: motion-event snapshots (default 30 days), background snapshots (14 days), video clips (7 days) — all configurable
- Runs anywhere Python is available; can also be deployed in a container
What it does not do
- No RTSP / live-stream pulling
- No motion detection or object recognition (delegated to cameras)
- No multi-user roles or cloud sync
Status
Late beta — core functionality (Dahua adapter, transcode pipeline, web UI, snapshot ingestion, event grouping, tiered retention) 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.
Project details
Release history Release notifications | RSS feed
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-0.10.1.tar.gz.
File metadata
- Download URL: cang-0.10.1.tar.gz
- Upload date:
- Size: 41.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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 |
93ed4ca8f805f9781a768be69df8831b09a2087557983b84d1e49c30e8d8ad42
|
|
| MD5 |
e59d80faa5b9fedc5eab6a7d643af94a
|
|
| BLAKE2b-256 |
680936f98c7185cee079993afd0c093d62108b3f6d727d431c5aba2b11706bdb
|
File details
Details for the file cang-0.10.1-py3-none-any.whl.
File metadata
- Download URL: cang-0.10.1-py3-none-any.whl
- Upload date:
- Size: 51.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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 |
106936f651a40c1d686de780c08877c1410f800ec2eb3d1e3cf0180d147fc628
|
|
| MD5 |
3b1eb29412cb2719768fc6180f412153
|
|
| BLAKE2b-256 |
1629c6b380dab5f683a7bc524e100e99fc5d284eaa506bac80bcd53050b1b4f1
|