Metadata-Version: 2.3
Name: cang
Version: 0.3.10
Summary: Lightweight NVR: watches folders, transcodes to H.264/MP4, serves a FastAPI web UI.
Author: Marvin8
Author-email: Marvin8 <marvin8@tuta.io>
License: AGPL-3.0-or-later
Requires-Dist: aiosqlite~=0.22.1
Requires-Dist: fastapi[standard]~=0.136.3
Requires-Dist: uvicorn~=0.48.0
Requires-Dist: watchdog~=6.0.0
Requires-Python: >=3.12
Project-URL: Issues, https://codeberg.org/MinimalNVR/cang/issues
Project-URL: Source, https://codeberg.org/MinimalNVR/cang
Project-URL: Changelog, https://codeberg.org/MinimalNVR/cang/raw/branch/main/CHANGELOG.md
Project-URL: Documentation, https://marvin8.codeberg.page/cang/latest/
Description-Content-Type: text/markdown

<p align="center">
  <img src="icon/cang_wordmark_light.png" alt="cang" width="280" height="80">
</p>

# Cang (藏) — Minimal Python Network Video Recorder

[![Licence: AGPL-3.0-or-later](https://img.shields.io/badge/licence-AGPL--3.0--or--later-blue)](LICENCE)
[![Status: Late beta](https://img.shields.io/badge/status-late%20beta-yellow)]()
[![Python 3.12+](https://img.shields.io/badge/python-3.12%2B-blue)](https://www.python.org/)
[![Documentation](https://img.shields.io/badge/docs-online-blue)](https://marvin8.codeberg.page/cang/latest/)
[![Woodpecker CI](https://ci.codeberg.org/api/badges/MinimalNVR/cang/status.svg)](https://ci.codeberg.org/MinimalNVR/cang)

**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](https://codeberg.org/LazyNVR/lazynvr-sources), written in Python.

## What it does

- Watches `incoming/<camera>/` directories for clips deposited by cameras
- Transcodes to H.264/MP4 with `-movflags +faststart` (browser-seekable)
- Indexes clips in SQLite: camera, timestamp, duration, thumbnail
- Serves a FastAPI + Jinja2 web UI: day → hour view, click-to-play
- Keeps clips marked as important; auto-expires the rest after configurable days
- 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) is working.
See the [documentation](https://marvin8.codeberg.page/cang/latest/) 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](LICENCE) for the full text.
