The architecture

One hub. One bus. Everything else subscribes.

The core, octosec_hub, is one epoll thread on raw syscalls with no libc. It ingests the cameras over RTSP and fans every stream out to whoever asked for it. Nothing else in the system talks to a camera, and no subscriber knows what the others are doing.

Ingest
up to 511 cameras · 2 RTSP streams each

A main and a substream per camera, pulled by the hub. Reolink today; a vendor driver is a shared object.

driveway
terrace
pergola  3.33:1
… 8 live, 2 planned
octosec_hub — the event bus
one epoll thread · no libc · ~2.4% of a core for 16 streams

Every frame, every event, every command and every outcome crosses here — and nowhere else. Facts, commands and outcomes all travel the same documented line protocol, which is why adding a consumer never means touching the ingest path.

Recorder

Motion-gated event clips: preroll, episode, postroll, contiguous.

Detector

Object detection on your own hardware, with a novelty tracker — so presence is not an event.

Camera control

One vendor-neutral vocabulary, with vendor shapes isolated in a driver.

Watchdog

A camera going dark is a first-class event with alarm rules, not a gap you find next week.

Also on the list: the live wall, the phone app, the exporter, the console — each one a process that asked the bus for what it needs. So is anything you write.

What travels on the bus

Frames. Annex-B video, as it arrived, to every subscriber that asked.
Events. Motion, detections by class, camera state, job progress. Written to events.jsonl as the searchable record.
Commands. One vendor-neutral vocabulary — reboot, PTZ, encoder, image profile — never a vendor's own shape.
Outcomes. What happened to each command, as an event anyone can act on.

Measured, with the box it was measured on

Whole stack, production footprint ~1.0 of 20 cores · <1 GiB QNAP TVS-h874 · 8 cam / 16 streams
Hub ingest cost ~2.4% of a core Same box · 16 RTSP streams
Bus latency, p95 0.064 ms · 0.210 ms TLS Loopback · debug build
Transport floor UDS ~5× loopback TCP Synthetic · 1 KB frames

Absolutes are box-dependent: ratios travel, absolutes do not. Every figure here names its machine and its build so you can repeat it on yours.

How far it scales, measured

We ramp fleets of virtual cameras — real RTSP, real H.265, served by our own synthetic camera — against the real recorder, the real motion gate and the real detector until something fails, and we write down what failed. A pass means every stream stayed online for the whole window, nothing was dropped by the hub or shed by a module, nothing was refused for size, no error was logged and every camera recorded.

These rows are from our development workstation in September 2026, not from the NAS the production fleet runs on. The method, every row and every failure along the way are in the repository's benchmark board.

Test hardware · Zen 5 9970X, 32 cores · NVIDIA RTX 5090, 32 GB VRAM · virtual cameras over real RTSP · beta15 tree
255 cameras · 1080p · detection at 3 fps each 639 inferences/s · 1.6 cores One GPU session at 89% · motion-gated recording · zero frames dropped · pass
127 cameras · 4K H.265 · recording, motion and detection <4 cores Decode on NVDEC · ~260 MB/s recorded continuously · zero frames dropped · pass
Hub ingest, 127 cameras of 1080p 0.03 cores · 2.6 GB 254 RTSP streams · cost linear in the camera count
Wire capacity 511 cameras 1,022 streams · two-byte camera id · a 512th is refused at boot, not lost

The detector's line is a GPU number: on a box without one the CPU provider holds far fewer cameras, and we say so on the detection page.

The fleet summary screen: per-class event counts across the fleet, rendered from the same event index the recorder writes. A design render, not a capture.
The same event index, rendered for a human · design render