How opensensor/lightnvr works
LightNVR is a self-hosted network video recorder. Operators configure cameras and policies through the web UI and REST API; camera streams are ingested, analyzed, recorded, retained, and made available for live viewing or investigation. The map also includes documented integrations and operational features. The excerpts chiefly expose storage and web-query internals; other relationships are included only where the README documents the capability, so some subsystem links remain intentionally absent.
Main entry points: LiveView.tsx Web interface · stream_manager.c Live streaming · storage_manager.c Storage management · api_handlers_storage_targets.c Storage controls
Components 17
Operator experience
- Web interface
web/js/components/preact/LiveView.tsx - REST API
src/web/api_handlers_streaming.c
Video workflows
- Live streaming
src/video/stream_manager.c - Detection
src/video/detection_integration.c - Recording
src/video/recording.c - Playback and investigation
src/web/api_handlers_recordings_playback.c
Data and storage
- Storage management
src/storage/storage_manager.c - Storage controls
src/web/api_handlers_storage_targets.c - SQLite database
src/database/db_core.c
Security and operations
- Authentication
src/web/api_handlers_auth_backend_agnostic.c - ONVIF discovery and events
src/video/onvif_discovery.c - MQTT events
src/core/mqtt_client.c - System health and metrics
src/telemetry/system_health.c - External archive
src/storage/storage_s3.c
Other components
- Operator
- IP camera
- MQTT broker
Connections 15
- Operator → Web interface: operates
README.md - Web interface → REST API: requests
README.md - IP camera → Live streaming: sends video
README.md - Live streaming → Recording: records streams
README.md - Live streaming → Detection: analyzes video
README.md - Web interface → Playback and investigation: reviews footage
README.md - REST API → Storage controls: configures storage
src/web/api_handlers_storage_targets.c - Storage controls → SQLite database: reads and writes
src/web/api_handlers_storage_targets.c - Storage controls → Storage management: probes targets
src/web/api_handlers_storage_targets.c - Storage management → SQLite database: reads recording data
src/storage/storage_manager.c - Operator → ONVIF discovery and events: discovers cameras
README.md - Operator → Authentication: authenticates
README.md - MQTT events → MQTT broker: publishes events
README.md - Operator → System health and metrics: views health
README.md - Storage management → External archive: archives recordings
README.md