Moonfire NVR, a security camera network video recorder
Go to file
Scott Lamb 6a5b751bd6 log error messages in web paths
HTTP requests were only returning the error message to the caller, not
logging locally. In most cases the problem could be understood
client-side, but there are some exceptions. E.g. if Moonfire returns
a 403 on WebSocket update, even in the Chrome debug tools's network
tab the HTTP response body seems to be unavailable. And in general,
it's nice to have more context server-side.

Logging a `response::Body` isn't practical (it could be a stream), so
convert all the web stuff to use `base::Error` err returns.

Convert the `METHOD_NOT_ALLOWED` paths to return `Ok` for now. This is a
bit lame but punts on having some way of plumbing an explicit/overridden
status code in `base::Error`, as no gRPC error kind cleanly maps to
that.

Also convert `db::auth`, rather than making up an error kind in the web
layer.

This is also a small step toward getting rid of `failure::Error`.
2023-07-09 10:15:56 -07:00
.cargo keep frame poiners in release mode 2019-07-20 15:33:12 -07:00
.github upgrade to Rust 1.70, use std::sync::OnceLock 2023-07-04 20:44:21 -07:00
.vscode upgrade to Retina 0.4.1 2022-08-09 08:02:07 -07:00
design config file reference and doc reorganization 2023-01-06 14:25:13 -06:00
docker improve docker cross-compilation 2023-01-11 19:35:37 -08:00
guide Add hyperink to the latest release in installation instructions 2023-07-08 17:18:59 -07:00
ref rework WebSocket error return protocol 2023-02-15 17:26:40 -08:00
screenshots Prepare v0.6.3 release 2021-03-31 15:21:09 -07:00
server log error messages in web paths 2023-07-09 10:15:56 -07:00
ui rework WebSocket error return protocol 2023-02-15 17:26:40 -08:00
.dockerignore start a new React-based UI (#111) 2021-02-17 19:42:32 -08:00
.gitignore ADD react router and reading from query params 2022-03-02 10:07:46 -08:00
AUTHORS Add myself as an author 2023-07-04 16:06:50 -07:00
CHANGELOG.md prep 0.7.6 release 2023-07-08 10:22:04 -07:00
CONTRIBUTING.md adjust support instructions 2021-04-27 11:08:54 -07:00
LICENSE.txt shorten per-file copyright headers 2021-02-17 15:39:17 -08:00
README.md prep 0.7.6 release 2023-07-08 10:22:04 -07:00
release.bash release script fixes 2021-03-12 13:33:08 -08:00

CI

Introduction

Moonfire NVR is an open-source security camera network video recorder, started by Scott Lamb <slamb@slamb.org>. It saves H.264-over-RTSP streams from IP cameras to disk into a hybrid format: video frames in a directory on spinning disk, other data in a SQLite3 database on flash. It can construct .mp4 files for arbitrary time ranges on-the-fly. It does not decode, analyze, or re-encode video frames, so it requires little CPU. It handles six 1080p/30fps streams on a Raspberry Pi 2, using less than 10% of the machine's total CPU.

Help wanted to make it great! Please see the contributing guide.

So far, the web interface is basic: a filterable list of video segments, with support for trimming them to arbitrary time ranges. No scrub bar yet. There's also an experimental live view UI.

list view screenshot live view screenshot

There's no support yet for motion detection, no https/TLS support (you'll need a proxy server, as described here), and only a console-based (rather than web-based) configuration UI.

Moonfire NVR is currently at version 0.7.6. Until version 1.0, there will be no compatibility guarantees: configuration and storage formats may change from version to version. There is an upgrade procedure but it is not for the faint of heart.

I hope to add features such as video analytics. In time, we can build a full-featured hobbyist-oriented multi-camera NVR that requires nothing but a cheap machine with a big hard drive. There are many exciting techniques we could use to make this possible:

  • avoiding CPU-intensive H.264 encoding in favor of simply continuing to use the camera's already-encoded video streams. Cheap IP cameras these days provide pre-encoded H.264 streams in both "main" (full-sized) and "sub" (lower resolution, compression quality, and/or frame rate) varieties. The "sub" stream is more suitable for fast computer vision work as well as remote/mobile streaming. Disk space these days is quite cheap (with 4 TB drives costing about $100), so we can afford to keep many camera-months of both streams on disk.
  • off-loading on-NVR analytics to an inexpensive USB or M.2 neural network accelerator and hardware H.264 decoders.
  • taking advantage of on-camera analytics. They're often not as accurate, but they're the best way to stretch very inexpensive NVR machines.

Documentation