Skip to content

cang

cang is a lightweight NVR (network video recorder) that watches camera recording folders, ingests snapshots and clips, groups motion events, applies tiered retention, and serves everything through a FastAPI web UI.

Features

  • Dahua camera adapter — reads .dav footage and JPG snapshots directly from the camera's folder structure
  • Snapshot ingestion — indexes all JPG snapshots in SQLite with motion-event metadata
  • Event grouping — automatically groups consecutive motion snapshots into events using a configurable time-gap threshold
  • Tiered retention — applies different expiry periods to motion snapshots (default 30 days), background snapshots (14 days), and video clips (7 days)
  • Watchdog-based file monitoring — picks up new recordings and snapshots without polling
  • ffmpeg transcoding pipeline — re-encodes .dav to H.264/MP4 with faststart
  • FastAPI web UI — browse recordings by day with events as the primary view, video clips collapsible on demand
  • Periodic re-scan — catches any files missed during downtime