docs: MIT license, license headers, README with project story and roadmap
This commit is contained in:
parent
cda6ca4785
commit
d4eada42d8
11 changed files with 114 additions and 107 deletions
21
LICENSE
Normal file
21
LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 NextNVR Contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
155
README.md
155
README.md
|
|
@ -1,36 +1,38 @@
|
||||||
# NextNVR
|
# NextNVR
|
||||||
|
|
||||||
A lightweight, self-hosted video recorder for IP cameras. Records 8 RTSP streams into 5-minute MP4 clips with near-zero CPU usage. Built for the **Casa Alba Mindelo** guesthouse.
|
A simple, single-binary IP camera recorder. Think of it as a dashcam for your property.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Why NextNVR?
|
||||||
|
|
||||||
|
The open-source NVR landscape is rich with incredible projects — Frigate, Shinobi, ZoneMinder, Blue Iris alternatives — backed by passionate communities. They're powerful. They're feature-packed. But they've also become complex. Docker containers, AI pipelines, multi-service architectures, cloud integrations — for many users, it's too much.
|
||||||
|
|
||||||
|
**NextNVR is different.** It does one thing: continuously record your IP cameras to disk and let you review the footage. No AI, no cloud, no Docker — just a single Go binary you can run on a Raspberry Pi 5, an old thin client, or a VM. Deploy it in 30 seconds with a one-liner.
|
||||||
|
|
||||||
|
This project was built with the help of AI — designed through conversation, refined through iteration, and shaped by the simple principle that surveillance software should be boring. It should just work.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Quick Install
|
## Quick Install
|
||||||
|
|
||||||
Copy and paste this single line into your terminal:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -sSL https://git.lohmar.co.uk/cclohmar/NextNVR/raw/branch/main/setup.sh | bash
|
curl -sSL https://git.lohmar.co.uk/cclohmar/NextNVR/raw/branch/main/setup.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
That's it. The script installs everything needed and starts NextNVR automatically.
|
That's it. The script installs everything and starts NextNVR automatically.
|
||||||
|
|
||||||
Once done, open the web interface in your browser (the script prints the URL).
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Supported Systems
|
## Supported Systems
|
||||||
|
|
||||||
| Distro | Package Manager | Status |
|
| Distro | Package Manager | Architecture |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| Debian 12+ / Ubuntu 22.04+ | `apt` | ✅ Tested |
|
| Debian 12+ / Ubuntu 22.04+ | `apt` | amd64, arm64 |
|
||||||
| Fedora 40+ / RHEL 9+ | `dnf` / `yum` | ✅ |
|
| Fedora 40+ / RHEL 9+ | `dnf` / `yum` | amd64, arm64 |
|
||||||
| Arch Linux | `pacman` | ✅ |
|
| Arch Linux | `pacman` | amd64, arm64 |
|
||||||
| Alpine Linux | `apk` | ✅ |
|
| Alpine Linux | `apk` | amd64, arm64 |
|
||||||
| Other (systemd) | auto-detect | ✅ |
|
| Raspberry Pi 5 | any above | arm64 |
|
||||||
| Other (no systemd) | fallback to `nohup` | ✅ |
|
|
||||||
|
|
||||||
- **ARM64** (Raspberry Pi, etc.) — auto-detected
|
|
||||||
- **Root or sudo** — handles both
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -38,103 +40,60 @@ Once done, open the web interface in your browser (the script prints the URL).
|
||||||
|
|
||||||
| Feature | Detail |
|
| Feature | Detail |
|
||||||
|---|---|
|
|---|---|
|
||||||
| 📹 **Recording** | 8 cameras simultaneously, 5-minute MP4 clips |
|
| 📹 **Recording** | Up to 8 cameras simultaneously, 5-minute MP4 clips, zero transcoding |
|
||||||
| 💾 **Storage** | Saves to `/mnt/recordings/` — keeps 18 days, auto-deletes older |
|
| 💾 **Storage** | Flat per-camera directories, 7-day retention, auto-cleanup |
|
||||||
| 🖥️ **Live Wall** | 4×2 grid showing all cameras at once. Click one to enlarge. |
|
| 🖥️ **Live Wall** | 4×2 grid with auto-refreshing snapshots. Click for full live stream |
|
||||||
| 🔍 **Playback** | Browse recordings by camera and date with presets (Today, Yesterday, Last 7 Days) |
|
| 🔍 **Playback** | Browse recordings by camera and date with snapshot thumbnails |
|
||||||
| ⚙️ **Setup Wizard** | Scans your network for cameras and helps you name them |
|
| ⚙️ **Setup Wizard** | ONVIF auto-discovery scans your network and pre-fills camera details |
|
||||||
| 🔒 **Local Only** | Everything runs on your own hardware. No cloud, no subscriptions. |
|
| 🔒 **100% Local** | Everything runs on your hardware. No cloud, no subscriptions, no telemetry |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Remote Access (Optional)
|
## Remote Access (Optional)
|
||||||
|
|
||||||
To access NextNVR from outside your home network:
|
1. **Dynamic DNS** — use DuckDNS, No-IP, or Cloudflare for a domain name
|
||||||
|
2. **Port forwarding** — forward port `8080` to the NextNVR server
|
||||||
1. **Dynamic DNS** — use a free provider like DuckDNS, No-IP, or Cloudflare to get a domain name (e.g. `myhouse.duckdns.org`)
|
3. For production, put NextNVR behind a reverse proxy (Zoraxy, Nginx) with HTTPS
|
||||||
2. **Port forwarding** — in your router settings, forward port `8080` to the NextNVR server
|
|
||||||
|
|
||||||
Then access your cameras from anywhere: `http://myhouse.duckdns.org:8080`
|
|
||||||
|
|
||||||
> ⚠️ For production use, put NextNVR behind a reverse proxy (like Zoraxy or Nginx) with HTTPS. Only port 443 needs to be forwarded — live streams are proxied through NextNVR automatically.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Server
|
## Roadmap
|
||||||
|
|
||||||
| What | Detail |
|
| Feature | Status |
|
||||||
|---|---|
|
|---|---|
|
||||||
| Web interface | `http://<server-ip>:8080` |
|
| Continuous recording (`-c copy`, zero transcoding) | ✅ Done |
|
||||||
| Config file | `/opt/nextnvr/config.yaml` |
|
| ONVIF auto-discovery + web setup wizard | ✅ Done |
|
||||||
| Recordings | `/mnt/recordings/` |
|
| Live wall with snapshot grid + focus view | ✅ Done |
|
||||||
| Logs | `sudo journalctl -u nextnvr -f` (systemd) or `tail -f /opt/nextnvr/nextnvr.log` (nohup) |
|
| Playback browser with date presets | ✅ Done |
|
||||||
|
| 7-day retention with auto-cleanup | ✅ Done |
|
||||||
|
| **Camera-triggered recording** (ONVIF motion/person detection events via API) | 🔜 Planned |
|
||||||
|
| **NAS/SMB storage support** (record to network share) | 🔜 Planned |
|
||||||
|
| **Multi-platform builds** (Raspberry Pi, ARM SBCs) | 🔜 Planned |
|
||||||
|
|
||||||
### Useful Commands
|
### Not Planned
|
||||||
|
|
||||||
|
- ❌ Cloud connectivity of any kind
|
||||||
|
- ❌ AI/ML object detection (use your camera's built-in detection)
|
||||||
|
- ❌ Mobile apps (the web UI is responsive and PWA-ready)
|
||||||
|
- ❌ User authentication (put it behind a reverse proxy)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Server Commands
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo systemctl status nextnvr # is it running?
|
sudo systemctl status nextnvr # is it running?
|
||||||
sudo systemctl restart nextnvr # restart after changing config
|
sudo systemctl restart nextnvr # restart
|
||||||
sudo systemctl stop nextnvr # stop recording
|
sudo journalctl -u nextnvr -f # watch logs
|
||||||
sudo journalctl -u nextnvr -f # watch live logs
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Config file: `/opt/nextnvr/config.yaml`
|
||||||
|
Recordings: `/mnt/recordings/`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## How It Works
|
## License
|
||||||
|
|
||||||
```
|
MIT — see [LICENSE](LICENSE)
|
||||||
IP Cameras NextNVR Your Browser
|
|
||||||
─────────── ────────── ─────────────
|
|
||||||
192.168.1.201 ─┐
|
|
||||||
192.168.1.202 ─┤ RTSP FFmpeg -c copy .mp4 http://192.168.1.10:8080
|
|
||||||
192.168.1.203 ─┼──────────► (no re-encoding) ────────► Live Wall + Playback
|
|
||||||
... ┤ 5 min segments Settings + Setup
|
|
||||||
192.168.1.209 ─┘ auto-delete >18d
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Zero transcoding** — FFmpeg copies the video stream directly. CPU stays under 5%.
|
Built with ❤️ and AI in Mindelo, Portugal. 🇵🇹
|
||||||
- **Crash-proof** — if a camera disconnects, it auto-reconnects after 5 seconds.
|
|
||||||
- **Atomic files** — recording in progress uses `.part.mp4`. Only renamed to `.mp4` when complete. No corrupted files.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Adding or Changing Cameras
|
|
||||||
|
|
||||||
1. Open the web interface in your browser
|
|
||||||
2. Click the **Settings** tab
|
|
||||||
3. Click **🔍 Scan Network** to find your cameras
|
|
||||||
4. Give each camera a name and description
|
|
||||||
5. Click **💾 Save Configuration**
|
|
||||||
6. Restart: `sudo systemctl restart nextnvr`
|
|
||||||
|
|
||||||
Or edit the config file directly:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo nano /opt/nextnvr/config.yaml
|
|
||||||
sudo systemctl restart nextnvr
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Updating
|
|
||||||
|
|
||||||
```bash
|
|
||||||
curl -sSL https://git.lohmar.co.uk/cclohmar/NextNVR/raw/branch/main/setup.sh | bash
|
|
||||||
```
|
|
||||||
|
|
||||||
The script pulls the latest version and restarts the service automatically.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
| Problem | Check |
|
|
||||||
|---|---|
|
|
||||||
| Can't open the web page | Is NextNVR running? `sudo systemctl status nextnvr` |
|
|
||||||
| No cameras showing | Check `config.yaml` — are camera IPs and passwords correct? |
|
|
||||||
| Recordings not saving | Does `/mnt/recordings/` exist? Is the disk mounted? (`df -h`) |
|
|
||||||
| Disk full | Recordings older than 18 days are auto-deleted. Check `df -h /mnt/recordings` |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Built with ❤️ in Mindelo, Portugal. 🇵🇹
|
|
||||||
|
|
|
||||||
5
api.go
5
api.go
|
|
@ -1,4 +1,7 @@
|
||||||
// NextNVR v0.1.0 — API handlers
|
// NextNVR — MIT License
|
||||||
|
// Copyright (c) 2026 NextNVR Contributors
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
// REST endpoints for cameras, configuration, ONVIF discovery, and status.
|
// REST endpoints for cameras, configuration, ONVIF discovery, and status.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
// NextNVR v0.3.3 — Storage retention cleaner
|
// NextNVR — MIT License
|
||||||
|
// Copyright (c) 2026 NextNVR Contributors
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
// Purges rec_*.mp4 and snap_*.jpg files older than retention_days.
|
// Purges rec_*.mp4 and snap_*.jpg files older than retention_days.
|
||||||
// Skips latest.jpg (live wall) and rec_*.part.mp4 (in-progress recordings).
|
// Skips latest.jpg (live wall) and rec_*.part.mp4 (in-progress recordings).
|
||||||
package main
|
package main
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
// NextNVR v0.1.0 — Configuration management
|
// NextNVR — MIT License
|
||||||
|
// Copyright (c) 2026 NextNVR Contributors
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
// Handles config.yaml parsing with sensible defaults
|
// Handles config.yaml parsing with sensible defaults
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
// NextNVR v0.1.0 — go2rtc child process management
|
// NextNVR — MIT License
|
||||||
|
// Copyright (c) 2026 NextNVR Contributors
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
// Launches and monitors go2rtc for WebRTC stream conversion.
|
// Launches and monitors go2rtc for WebRTC stream conversion.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
|
||||||
5
main.go
5
main.go
|
|
@ -1,4 +1,7 @@
|
||||||
// NextNVR v0.1.0 — Main entry point
|
// NextNVR — MIT License
|
||||||
|
// Copyright (c) 2026 NextNVR Contributors
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
// Lightweight NVR application for recording and monitoring IP cameras.
|
// Lightweight NVR application for recording and monitoring IP cameras.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
|
||||||
5
onvif.go
5
onvif.go
|
|
@ -1,4 +1,7 @@
|
||||||
// NextNVR v0.3.0 — ONVIF device discovery (hybrid approach)
|
// NextNVR — MIT License
|
||||||
|
// Copyright (c) 2026 NextNVR Contributors
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
//
|
//
|
||||||
// Strategy:
|
// Strategy:
|
||||||
// 1. TCP-probe port 80 — if reachable, try ONVIF GetDeviceInformation.
|
// 1. TCP-probe port 80 — if reachable, try ONVIF GetDeviceInformation.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
// NextNVR v0.3.3 — FFmpeg stream recorder
|
// NextNVR — MIT License
|
||||||
|
// Copyright (c) 2026 NextNVR Contributors
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
// Records 5-minute segments with rec_ prefix and second-level timestamps.
|
// Records 5-minute segments with rec_ prefix and second-level timestamps.
|
||||||
// Output: /mnt/recordings/{cam-name}/rec_{YYYY-MM-DD-HH-MM-SS}.mp4
|
// Output: /mnt/recordings/{cam-name}/rec_{YYYY-MM-DD-HH-MM-SS}.mp4
|
||||||
package main
|
package main
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
// NextNVR v0.1.0 — HTTP server and routing
|
// NextNVR — MIT License
|
||||||
|
// Copyright (c) 2026 NextNVR Contributors
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
// Serves the embedded SPA and API endpoints.
|
// Serves the embedded SPA and API endpoints.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
// NextNVR v0.3.4 — Snapshot engine (go2rtc-based)
|
// NextNVR — MIT License
|
||||||
|
// Copyright (c) 2026 NextNVR Contributors
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
// Fetches JPEG frames from go2rtc's already-decoded stream buffer.
|
// Fetches JPEG frames from go2rtc's already-decoded stream buffer.
|
||||||
// go2rtc maintains persistent RTSP connections — frames are instant.
|
// go2rtc maintains persistent RTSP connections — frames are instant.
|
||||||
// Writes latest.jpg every 1s (live wall) and snap_*.jpg every 60s (archive).
|
// Writes latest.jpg every 1s (live wall) and snap_*.jpg every 60s (archive).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue