Repository navigation
EN Detection and AI
Without AI: FFmpeg decodes the sub-stream into small grey pictures (320 px, 5 pictures per second), compared with a slowly adapting background. Measured cost: ≈ 2.4 % of one core per camera. FFmpeg is needed.
It is turned on camera by camera: the camera's page → Detection tab → « Detect motion on this camera ».
- Sensitivity: from 1 (only large changes) to 100 (the slightest change). Changes of the overall lighting are ignored.
- Detection zones: polygons drawn on the picture, each with its own sensitivity. With zones, nothing counts outside them; without a zone, the whole picture counts. The zone's name comes with the event.
- Privacy masks: rectangles (a neighbour's window, the street) ignored by detection and blacked out on the pictures (thumbnails, captures, notifications). The recorded video, never re-encoded, stays whole.
Each motion becomes an event: thumbnail, Events page, playback timeline, MQTT and notifications. An event ends a few seconds after the motion stops.
(Since 2026.11.08) The Events page searches up to 30 days at once, by recognized object and by zone (once a camera is chosen). On the timeline, an event with a recognized object is marked in green and named; its thumbnail shows on hover.
Shadows, foliage and rain can trigger it: lower the sensitivity, draw zones, or add AI to keep only what matters.
Frozen or covered picture (since 2026.11.10): while it runs, detection also notices a picture that no longer changes at all for 5 minutes (a stuck camera still sending its stream) or that turns uniform or blurred at once for 1 minute (lens covered, a hand in front of the camera — recognized after 2026.11.10 —, light switched off). The camera then shows a red badge, and the « Camera offline / back » notifications report it, then its return. Night falling slowly and the infrared switching on do not count. For a dark room whose light is switched off in the evening, untick « Report a frozen or covered picture » in the camera's Detection tab. Outside the ranges of its schedule, nothing is looked at.
Schedule (since 2026.11.08): in the Detection tab, ranges (days and hours, for example « every day from 22:00 to 06:00 » or « Saturday and Sunday, all day ») limit the camera's detection. Outside them, motion and crossings do not count: no event, no notification, and a camera « on motion » does not record. Continuous recording and manual events do not change. Without a range, detection works all the time.
Pausing all detection (« at home » mode): the « Detection (all cameras) » switch in Home Assistant (or MQTT). The interface then shows a banner with a « Resume » button. The pause survives a restart; while paused, cameras recording « on motion » record nothing.
Detection tab → Crossing lines (4 per camera): click two points on the picture (gate, door, path). Each crossing is counted:
- Direction: both, the way of the arrow, or the other way;
- Objects: with AI, a crossing only counts when one of the ticked objects (for example « Person ») is seen at the line;
- Count presence: the arrow shows the way in; RustNVR counts who is inside (ins minus outs since midnight or the reset).
The counts show in the interface and in Home Assistant (MQTT), and a crossing can trigger a notification.
When someone walks past several cameras (doorbell, then entrance, then living room), RustNVR can group these events into one journey. It needs the AI (below): only events where an object is recognized count.
Settings → Journeys: tell which camera may follow which other, one arrow at a time. For example:
Doorbell → Garage
Doorbell → Entrance
Garage → Entrance
Entrance → Living room
Any path that follows the arrows is recognized, whole or in part (Doorbell → Entrance → Living room, or Garage → Entrance). For each arrow:
- Max delay (30 s by default): the longest time between the end of the event on the first camera and the start of the one on the next. Allow plenty if one may stop on the way (putting the shopping down).
- Also the other way (ticked by default): for someone leaving.
A journey only links the same kind of object (a person then a person). When two people walk by at once and RustNVR cannot tell who is who, it links nothing rather than getting it wrong. The cameras are put in the order they saw motion, even when the AI recognizes the person later on one of them.
In Events, a journey is one card with the pictures one after the other and the path (« Doorbell → Entrance → Living room »); a click opens it in Playback, its cameras side by side, at the moment it starts. The interface shows a notification when the journey is over. The card's Export button makes one MP4 of the journey: the cameras one after the other, with a « camera · time » banner and their sound (to keep it or send it).
Off by default, and no model is shipped. AI only analyses the pictures of detected motion (5 at the start of each event), never the stream continuously: it tells what moves (person, car, dog…).
(Since 2026.11.10) During a long motion, the AI keeps looking: one picture every 30 s while the motion lasts (your choice: 30 s, 1 min or not at all). Rain in infrared light, wind in the trees or headlights can make a motion last for minutes; without this, someone passing meanwhile would not be recognized. Cost with the built-in model: ≈ 4 % of one core per camera concerned, only during such motion.
Settings → Artificial intelligence, two providers:
| Provider | For |
|---|---|
| Built-in (YOLOX, run by RustNVR) | nothing else to install: Download button (YOLOX-nano, 3.7 MB, hash checked), then Save |
| CodeProject.AI / DeepStack | a separate server, mostly useful with an NVIDIA card |
Choosing a built-in model (one desktop processor core):
| Model | Time per picture | Result on real pictures |
|---|---|---|
| YOLOX-nano | ≈ 38 ms | people by day; misses people at night |
| YOLOX-s | ≈ 410 ms | every person, night included, no false alarm: the best trade-off |
| YOLOX-m | ≈ 830 ms | more confident, the largest reasonable without a graphics card |
(Since 2026.11.10) Installed from the archive (Debian, Proxmox), RustNVR
computes with ONNX Runtime, shipped with it: 2 to 4 times faster than
the times above, with the same results (YOLOX-m ≈ 0.3 s on an i5-6500,
YOLOX-s ≈ 1.7 s on a Raspberry Pi 4). Settings → Artificial intelligence
shows "Computing: CPU · ONNX Runtime". The Docker image keeps the former
engine for now ("CPU · tract"). ONNX Runtime spreads each picture over all
the cores of the container or LXC: the more it has, the faster (YOLOX-m:
0.8 s with 2 cores, 0.3 s with 4). To leave one free,
on a Raspberry Pi for instance, add RUSTNVR_AI_THREADS=3 to
/etc/rustnvr/rustnvr.env and restart RustNVR.
Useful settings:
- Minimum confidence: 0.5 is a good start for the built-in model; a stricter threshold at night avoids insects and rain in infrared. The night can follow fixed hours, or (since 2026.11.08) each camera's night vision: the night threshold applies as soon as it switches to black and white, a dark day or a garage included.
- Objects to recognize: globally, then per camera (Detection tab).
- Objects per zone: a person only counts when their feet are in a zone where « Person » is ticked; someone on the pavement is ignored.
- Analyse: shows what AI sees on a capture of a camera.
Full-resolution photo from the camera (since 2026.11.10): by default, an event's picture comes from the sub stream (often 640 px wide). In the Detection tab of a camera whose ONVIF port is set, the « Full-resolution photo from the camera (ONVIF) » box asks the camera itself for it, in full definition (masks applied): thumbnail, AI, notifications and kept pictures are sharper. Size: 1280 px (light), 1920 px (advised) or the camera's own size, heavier but handy to zoom on a face or a plate; AI gains nothing, it analyses at 640 px. The Try button shows the photo, its size and how long the camera takes to give it: decide camera by camera. Not every camera gives its full definition through ONVIF: an EZVIZ H8c, for instance, only gives 768×432 for a 1920×1080 stream; the option then brings nothing. A Reolink PoE doorbell gives 1920×1440, but Reolink cameras serve the photo on their HTTP port, off by default: turn it on in the Reolink app (Network → Advanced → Port settings → HTTP). When the camera does not give it within 3 s, or refuses, the event takes the usual picture and the log says why.
Keep the analysed pictures, then Replay the AI: RustNVR keeps each analysed picture with what it found there, and can replay a day with other settings (« Before: nothing · Now: Person 78 % »). It is the right way to pick a model or a threshold on your own pictures. One picture is deleted from the Pictures page (since 2026.11.11), a whole day from « Replay the AI ».
Settings → Artificial intelligence → tick Read license plates, then download the two small models offered (13 MB in all, MIT licence) and save. It works with the built-in AI as with CodeProject.AI.
When a car, truck, bus or motorcycle is recognized, RustNVR takes a picture
of the main stream and reads the plate. It shows in the event (« Car
92 % · AB-123-CD »), goes to MQTT and the notifications (variable
{plaque}), and can be searched in Events → Plate (a part is
enough: AB-12).
The plate must be at least 60 pixels wide in the picture: a camera filming the entrance or the driveway close enough. A plate is kept only when every character is read with high confidence: better nothing than a wrong plate. Plates stay on your server, and go away with the events.
Known plates: under « Read license plates », « Add a plate » links a
plate to a name (« Paul's car »). When it is read, the name shows with it:
« AB-123-CD (Paul) » in the event, in the notifications ({plaque}) and in
MQTT (plate_owner).
When the provider does not answer, the event is recorded anyway, without objects. Details, measurements and graphics cards (in French): docs/AI.md.