{"id":47628516,"url":"https://github.com/rvben/vedetta","last_synced_at":"2026-05-11T15:19:23.552Z","repository":{"id":345897859,"uuid":"1187378943","full_name":"rvben/vedetta","owner":"rvben","description":"Vedetta NVR — lightweight open-source network video recorder with object detection","archived":false,"fork":false,"pushed_at":"2026-05-02T09:03:00.000Z","size":4290,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-02T11:29:42.059Z","etag":null,"topics":["nvr","object-detection","security-camera","surveillance","video"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rvben.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-20T16:54:21.000Z","updated_at":"2026-05-02T09:03:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rvben/vedetta","commit_stats":null,"previous_names":["rvben/vedetta"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/rvben/vedetta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvben%2Fvedetta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvben%2Fvedetta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvben%2Fvedetta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvben%2Fvedetta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvben","download_url":"https://codeload.github.com/rvben/vedetta/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvben%2Fvedetta/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32900546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nvr","object-detection","security-camera","surveillance","video"],"created_at":"2026-04-01T23:02:54.902Z","updated_at":"2026-05-11T15:19:23.490Z","avatar_url":"https://github.com/rvben.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vedetta\n\nVedetta is an open-source Network Video Recorder (NVR) written in Go. Inspired by [Frigate](https://frigate.video), it ships as a single binary with no Python dependency.\n\n## Features\n\n- **Object detection** -- YOLOv8 via ONNX Runtime (pure-Go or C backend)\n- **Continuous recording** -- segment-based with configurable retention\n- **Event clips** -- pre/post capture around detected objects\n- **Motion detection** -- contour-based; YOLO runs only when motion is detected\n- **Object tracking** -- Hungarian algorithm across frames\n- **Live streaming** -- WebRTC with MJPEG fallback\n- **Web dashboard** -- dark theme, htmx + vanilla JS, no build step\n- **Session auth + API tokens** -- browser sessions with CSRF protection and scoped bearer tokens\n- **Home Assistant** -- MQTT integration with auto-discovery\n- **ONVIF discovery** -- find cameras on the network (`vedetta discover`)\n- **Per-camera zones** -- filter which objects matter in each zone\n- **Storage management** -- max storage cap, automatic cleanup\n- **SQLite** -- WAL-mode database, embedded in the binary\n- **Single binary** -- static files embedded with `go:embed`\n\n## Quick Start\n\n### Binary\n\nDownload the latest release from [Releases](https://github.com/rvben/vedetta/releases), or build from source:\n\n```sh\nmake build\n./build/vedetta\n```\n\n### Docker\n\n```sh\ndocker run -d \\\n  --name vedetta \\\n  --network host \\\n  -v vedetta-config:/config \\\n  -v vedetta-data:/data \\\n  ghcr.io/rvben/vedetta:latest\n```\n\nA `docker-compose.yml` is included in the repository.\n\nHost networking is required for RTSP camera access and ONVIF multicast discovery. On first run without a config file, Vedetta starts a setup wizard at `http://\u003chost\u003e:5050`.\n\n## Configuration\n\nVedetta is configured with a single YAML file. See [`config.example.yml`](config.example.yml) for a complete example.\n\n### Cameras\n\n```yaml\ncameras:\n  - name: front_door\n    url: rtsp://user:pass@192.168.1.100:554/stream1\n    record_url: rtsp://user:pass@192.168.1.100:554/stream0  # optional high-res stream\n    detect:\n      enabled: true\n      width: 640\n      height: 480\n      fps: 5\n    record:\n      width: 1920\n      height: 1080\n      fps: 15\n    zones:\n      - name: driveway\n        points:\n          - [0.1, 0.5]\n          - [0.9, 0.5]\n          - [0.9, 1.0]\n          - [0.1, 1.0]\n        labels: [person, car]\n```\n\nEach camera has two optional streams: `url` for the detection stream (lower resolution, less CPU) and `record_url` for recording (full resolution). If `record_url` is omitted, `url` is used for both.\n\nZones are polygons defined as normalized points (0.0--1.0). Event matching uses the detection anchor point `(center_x, bottom_y)`.\n\n### Detection\n\n```yaml\ndetect:\n  model_path: \"\"            # path to YOLOv8 ONNX model\n  score_threshold: 0.5      # minimum confidence score\n  motion:\n    pixel_threshold: 25\n    min_area: 200\n    background_alpha: 0.05\n    min_region_score: 0.02\n```\n\n### Recording\n\n```yaml\nrecording:\n  path: ./recordings\n  continuous: true           # record continuously, not just events\n  segment_length: 10m        # length of each continuous segment\n  pre_capture: 5s            # seconds before event to include in clip\n  post_capture: 10s          # seconds after event to include in clip\n  retain_days: 7             # delete continuous segments after N days\n  event_retain_days: 30      # keep event clips longer\n```\n\n### Storage\n\n```yaml\nstorage:\n  db_path: ./vedetta.db\n```\n\n### MQTT\n\n```yaml\nmqtt:\n  enabled: false\n  host: 127.0.0.1\n  port: 1883\n  topic: vedetta\n```\n\n### API\n\n```yaml\napi:\n  host: 0.0.0.0\n  port: 5050\n  exposure: lan\n  # trusted_proxies:\n  #   - 127.0.0.1/32\n  # tls_cert: /etc/vedetta/tls.crt\n  # tls_key: /etc/vedetta/tls.key\n```\n\n### Auth\n\n```yaml\nauth:\n  users:\n    - username: admin\n      password_hash: \"$2a$10$7EqJtq98hPqEX7fNZaFWoOHi8V6I5WJFlQ7Y7S6d6n9zQ0jD4S3yu\"\n```\n\nGenerate hashes with `vedetta auth hash-password \u003cpassword\u003e`.\n\n## Camera Setup\n\nCommon RTSP URL formats for popular camera brands:\n\n| Brand | Main Stream | Sub Stream |\n|-------|------------|------------|\n| **Tapo** | `rtsp://user:pass@IP:554/stream1` | `rtsp://user:pass@IP:554/stream2` |\n| **Reolink** | `rtsp://user:pass@IP:554/h264Preview_01_main` | `rtsp://user:pass@IP:554/h264Preview_01_sub` |\n| **Hikvision** | `rtsp://user:pass@IP:554/Streaming/Channels/101` | `rtsp://user:pass@IP:554/Streaming/Channels/102` |\n| **Dahua** | `rtsp://user:pass@IP:554/cam/realmonitor?channel=1\u0026subtype=0` | `rtsp://user:pass@IP:554/cam/realmonitor?channel=1\u0026subtype=1` |\n\nUse `vedetta discover` to scan the local network for ONVIF-compatible cameras and print their RTSP URLs.\n\n## MQTT / Home Assistant\n\nWhen MQTT is enabled, Vedetta publishes Home Assistant auto-discovery messages so cameras and sensors appear automatically.\n\nThe default topic prefix is `vedetta`. Messages are published under:\n\n- `vedetta/\u003ccamera\u003e/detection` -- object detection events\n- `homeassistant/binary_sensor/vedetta_\u003ccamera\u003e/config` -- auto-discovery\n\n## API Endpoints\n\n| Method | Path | Description |\n|--------|------|-------------|\n| `GET` | `/api/health` | Health check |\n| `GET` | `/api/health/live` | Liveness probe |\n| `GET` | `/api/health/ready` | Readiness probe |\n| `POST` | `/api/auth/login` | Create browser session |\n| `POST` | `/api/auth/logout` | End browser session |\n| `GET` | `/api/auth/me` | Current principal |\n| `POST` | `/api/tokens` | Create scoped API token |\n| `DELETE` | `/api/tokens/{id}` | Revoke API token |\n| `GET` | `/metrics` | Prometheus metrics |\n| `GET` | `/api/system` | System status (CPU, memory, storage) |\n| `GET` | `/api/cameras` | List all cameras and their status |\n| `GET` | `/api/cameras/{name}/snapshot` | Current JPEG snapshot from camera |\n| `GET` | `/api/cameras/{name}/mjpeg` | MJPEG live stream |\n| `POST` | `/api/cameras/{name}/webrtc/offer` | WebRTC signaling (SDP offer/answer) |\n| `GET` | `/api/events` | List recorded events |\n| `GET` | `/api/events/{id}` | Get single event details |\n| `GET` | `/api/events/{id}/snapshot` | Event thumbnail |\n| `GET` | `/api/events/{id}/clip` | Download event video clip |\n\nThe web dashboard is served at `/` and uses htmx partials for dynamic updates.\n\n## Development\n\nPrerequisites: Go 1.22+. Vedetta no longer downloads the ONNX model or OpenH264 at runtime; install them ahead of time or bundle them with your deployment.\n\n```sh\nmake build          # build the binary\nmake build-capi     # build with C ONNX Runtime backend\nmake test           # run tests\nmake bench          # run detection benchmarks\nmake lint           # run golangci-lint\nmake fmt            # format code\nmake check          # lint + test\nmake clean          # remove build artifacts\n```\n\n## Architecture\n\n```\nRTSP Camera\n    |\n    v\n Native Go RTP/H264 decode ──\u003e Motion Detector\n                                   |\n                              (motion detected)\n                                   |\n                                   v\n                             YOLOv8 Detector ──\u003e Object Tracker\n                                   |                  |\n                                   v                  v\n                             Event Manager       MQTT Publisher\n                                   |\n                             +-----+-----+\n                             |           |\n                       Event Clips   Continuous Segments\n```\n\nFrames flow from camera through motion detection. YOLO only runs when motion is detected, keeping CPU usage low. Detected objects are tracked across frames with the Hungarian algorithm to maintain identity. Events trigger clip extraction from the continuous recording buffer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvben%2Fvedetta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frvben%2Fvedetta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvben%2Fvedetta/lists"}