Reeve Docs

Docs / Architecture

Cameras and media transport

How a camera's picture reaches a viewer, and the rules that keep that path private. The negotiated (WebRTC) transport and the media plane's viewer side are on camera-webrtc-signalling.md.

A camera is a canonical device whose media lives in a plugin's workload, or only inside an optional shared media plane the operator deploys. The backend owns every route a client knows. It proxies bytes from a media origin the plugin declares, relays the negotiation of a peer connection, or registers the camera on the media plane and relays the viewer's negotiation with it. Reeve core stores no video and no snapshots.

The proxy contract

Route Carries
GET /api/devices/{id}/camera/stream-info the negotiated transport for this device
GET /api/devices/{id}/camera/snapshot a single JPEG frame
GET /api/devices/{id}/camera/stream.mp4 progressive fMP4; no client plays it
HEAD /api/devices/{id}/camera/stream.mp4 the viewer-slot verdict, and nothing else
GET /api/devices/{id}/camera/stream.ws the live picture: fMP4 over a WebSocket
GET /api/devices/{id}/camera/webrtc.ws the negotiation of a peer connection (see camera-webrtc-signalling.md)
GET /api/devices/{id}/camera/events/{eventId}/snapshot.jpg the still frame the camera kept for one detection
GET /api/devices/{id}/camera/events/{eventId}/clip.mp4 the recorded clip for that same detection

The camera media proxy is the only path to a frame

A camera workload is never exposed to the browser, the LAN or the internet: clients know only Reeve's own routes under the device, and the backend dials the workload in-process. Access control then applies to every frame, including per-user device overrides, and the operator configures nothing. Any new transport must survive HTTP or a WebSocket; a client that "just needs the stream URL" is asking for something that does not exist. Breaking this produces a working-looking system with no error: a picture that bypasses every access check.

A plugin-supplied media path stays inside its declared origin

A media path must be rooted, carry no authority and contain no upward segment (however its dots are spelled), and it must resolve to the same scheme, host and port as the declared origin. Media paths are routinely built from device data that came off the network, so a path that escapes the origin aims the proxy, with the viewer's session behind it, at an address nothing checked.

The proxy follows no redirects

The origin is checked once before the request goes out; a redirect would re-aim the client at an address nothing checked. A 3xx therefore ends the exchange and becomes a gateway error, because its Location header would leak the workload's address. The media-plane control and remux clients disable redirects for the same reason.

Media routes answer 403 to any request carrying a bearer token. Media elements send no authorization header, so the cookie is the only credential involved, and a personal access token cannot fetch a camera. A browser with no Reeve session is refused a step earlier, with 401, by the access-token policy.

Access is checked when a stream opens, and a revocation ends it

A live stream (the fMP4 WebSocket, the progressive MP4, the WebRTC signalling relay and the Matter-bridge media stream) is checked once when it opens, and then registered in the replica's credential index with an abort, as a hub connection is (live revocation). A revocation hint for the viewer's session or user aborts it on whichever replica serves it; a change to the viewer's override or time windows on a camera publishes a user hint once the write is acknowledged (every serving replica has applied it), so the viewer's open streams end and a reopen is checked against the new access. When the viewer's access to the camera rests on a time window, the stream is aborted when the window closes, as computed at open in the home time zone. Event clips and stills are bounded and are not tracked.

A snapshot has an end-to-end deadline; a live stream has none

The proxy opens the upstream response under a deadline that bounds the whole exchange, body included, because ConnectTimeout covers only the connection attempt: a workload that accepts the connection and never sends headers would otherwise hold the request, and the browser, open forever. Snapshots pass a deadline (five seconds by default) and live streams pass none, because a client-wide HttpClient.Timeout would cut a live body mid-flight; the viewer's disconnect ends a stream. The deadline is owned by the response and disposed with it.

Media responses are no-store, and the upstream's status is restated

A camera's URL never changes, so without no-store the browser answers a poll from cache and keeps the private picture on disk. The upstream's status is restated in Reeve's own words: a 401 or 403 would trip the front end's sign-out interceptor, a 429 is indistinguishable from the viewer limit, and the body can carry a stream name or a trace. A 429 limit verdict is never cacheable: a stored one would pin a surface at the limit after a slot frees.

A long stream holds a viewer slot; a snapshot takes none

A stream holds and renews a viewer slot for as long as the viewer watches, and releases it on the disconnect path; the release runs in a finally and must never fault. A clean close frame, a deadline or host stop all return the slot promptly. A renewal after expiry reclaims within the budget or refuses. Refusal ends an HTTP stream by ending its body, since no status can be sent after streaming starts; the media WebSocket sends close status 1008 with reason viewer limit under a two-second deadline, then cancels the stream; WebRTC queues an end with reason viewer limit and the relay cancels the session if it cannot be sent within two seconds. A snapshot never takes a slot, or a poll would lock a camera out of its own preview: a poll gets a deadline, a stream does not.

A closed privacy shutter withholds the still

The live snapshot is refused while the camera's privacy shutter is closed or livestream privacy is on, with 409 and an errorCode of PrivacyShutterClosed or LivestreamPrivacyOn, and without asking the workload. 409 rather than 403, because the caller may view the camera and the refusal is temporary; it is decided before the plugin is asked, so a withheld still is never fetched. The rule (CameraStillPrivacy) reads the stored canonical state ICameraMediaAccess already loads, so the Matter bridge's snapshot refuses on the same terms. Hiding the still in one client is not enough, since any other client or a direct request would still get it. A camera that declares neither capability is served.

The live transports are not gated the same way. Fragmented MP4, the WebSocket stream, WebRTC negotiation and the Matter bridge's stream open whatever the privacy state says, and rely on the camera honouring its own privacy mode: a camera switched to privacy stops its media, and the viewer treats the drop as an outage (camera WebRTC signalling). A camera that keeps streaming while it reports privacy on is shown; that residual risk is in known limitations.

A compact tile takes the still, never a session

A device-list card and the room widget's row render a preview nobody is watching. Mounting a live rung there would open a real stream per camera and hold one of its viewer slots, so a list could lock a maxViewers: 1 camera out of the detail page it links to. useCameraMedia's stills-only mode therefore drops every live URL rather than leaving it unplayed, because transportOf reads them and a survivor would name fMP4 over a JPEG. The rule covers the compact surfaces and no others: the dashboard's camera widget is a tile someone placed in order to watch, and it keeps the full ladder. A camera that publishes no still says so on a compact tile rather than falling back to a session; that covers every camera that only negotiates, and any proxied camera declaring an MSE path but no snapshot path, because SupportsSnapshot and SupportsMse are independent flags.

A tile's verdict is never frozen, and claims only what failed

The media URLs are constant paths and the client does not refetch stream-info on focus, so a frozen verdict on a single-frame tile has no exit until a reload. A failed still therefore probes its own route back on the recovery backoff, which costs no slot; it is pinned to the still, since probing the stream would spend one of maxViewers per tick. A tile's slow lane keys on probes spent (it has no transport failures to count), and a frame that renders resets the interval. The message says only that no picture arrived: the shared "not available" would condemn a camera whose stream the detail page plays at that moment. A state that makes the frozen frame wrong removes it: a closed privacy shutter or livestream privacy switched on. Both messages state device state rather than claiming anything about the picture, and the live panel is never suppressed.

The slot verdict is asked with HEAD and never opens a stream

A GET answers the same question only by acquiring a slot, dialling the workload and registering a restreamer consumer for a body nobody reads. The HEAD action takes a slot, releases it in the same statement and returns 200 or 429; it never touches the proxy or the workload. It takes the slot rather than counting, because acquiring is the only atomic way to ask. MVC routes no HEAD to a GET action (it answers 405), so the route exists explicitly, with the same no-store, cookie-only rule and access check as every media route. The progressive route remains for this reason: a browser hides a failed WebSocket handshake's status from script.

A HEAD answers availability, never liveness

It never reaches the workload, so a dead camera answers it as a healthy one does. Whatever needs to know the camera is alive asks the snapshot, which reaches the workload and costs no slot; a camera with no snapshot has nothing cheaper than opening the real stream, so its recovery probe is a GET that aborts the moment it has its status.

A degraded surface probes its way back with a probe that can answer

A camera that is simply unavailable is asked for its snapshot: the snapshot fails exactly when the workload is gone and costs no slot. A camera at its viewer limit is asked with HEAD, because the snapshot answers throughout the limit and can never report that a slot came free. Both paths back off. Without the second path a single 429 leaves the viewer on one-frame-per-second stills until a reload. A transport failure whose probe cannot even be sent (the viewer's own network dropped, or the device woke from sleep) degrades the same way, with a message that says the connection was lost rather than that the camera is unavailable, and probes back on the same backoff; without it the dead player stays mounted and the surface shows its last frame as live until a reload. Those diagnosis probes give up after ten seconds, because a network that swallows packets would otherwise hold one open for minutes and keep every later failure report waiting behind it.

Escalation needs evidence of progress

A probe answering 200 proves the transport is up, not that this client can play it: a blocked CSP, an unsupported codec and a mismatched handshake each produce a client that never gets a frame, and "the transport is fine, so rebuild it" is then a reconnect loop with a real upstream stream per attempt. Transport failures with no frame between them are counted: past the fourth the recovery interval widens to minutes, past the eighth the transport is not attempted again for that camera on that page and the surface stays on stills with a message. A played frame clears the count, and so does a different stream-info answer. A failure the player can classify itself (MediaSource finding no supported type, addSourceBuffer throwing, a source buffer or decoder error, a handshake with no mimeTypes) is reported as unplayable and settles on stills at once. A failed still frame is not a transport failure and never spends the transport's escalation.

Viewer slots and admission

Viewer budgets are held slots on PostgreSQL, and the gate degrades open

Viewer budgets are the cluster library's held slots on PostgreSQL, judged on the database clock: three viewers per camera by default (Cameras:Media:MaxViewersPerCamera). A slot is the viewer's socket on one replica; it lives 30 seconds, a live viewer renews it every 10, and a crashed replica's slots free within the slot lifetime. The gate admits on an unknown commit or a database error, while a replica that is not serving refuses. A caller told it holds a slot must renew and release it; no caller releases a slot it was never told it holds. The general rule is Postgres arbitrates ownership, liveness and held slots.

Event media has a budget of its own, and the two never share a key

The event routes take no viewer slot: a link opened from a notification must not be able to evict a live viewer or lock the household out of its live view. They draw on a separate per-camera budget, four by default (Cameras:Media:MaxEventMediaPerCamera), under its own key. The API-wide concurrency limiter does not count camera media: it holds a permit until the response ends, so a live socket or stream, or a sixty-second clip, would hold one for its whole duration and an ordinary household's viewers would answer 429 to every other request on the API. The viewer and event-media budgets are what bound camera media. A non-positive setting of either budget falls back to its default rather than locking everyone out.

A negotiation is a viewer like any other

A WebRTC negotiation takes a slot from the same per-camera budget as a stream, renewed and released on the same terms. A camera that only negotiates is still served, and the plugin alone decides its transport. The camera's own encoder budget is invisible to this gate and is the plugin's to enforce.

A camera with no transport is explained only by a deployment fact

stream-info answers 503 for a camera with no transport at all, which reads as an outage to wait out. Two causes are named, both facts about the deployment: MediaPlaneNotConfigured when the plugin declares a plane ingest and no plane is configured, and MediaPlaneTransportDisabled when the plane serves the camera but neither live rung (WebRTC, fMP4) is effective. Anything else stays unnamed, because a wrong reason sends the operator to a setting that is present and correct. The check reads the narrowed switch reading, never the stored one, and counts only the two live rungs: snapshots are not the plane's to switch off.

One detection's media

Two event routes address what the camera plugin already stored for a single detection. Reeve keeps no copy of either file: a copy would mean a second retention policy and a second disk budget for files the camera already keeps. A workflow block turns a detection's event id into the two links. The plugin declares the paths as templates on the media origin, as init properties on the record body and never as new positional constructor parameters, because every published camera plugin calls that constructor positionally and widening it removes it from the plugin ABI. The block declares itself idempotent explicitly, because the interface default would fail a crash-recovery resume of any workflow containing it. The clip carries a deadline of its own, sixty seconds against the snapshot's five, because the proxy's deadline bounds the whole body.

The event id is checked twice, against a closed character set

The event id is data a plugin read off a broker, composed by the host into a path on the workload. Origin confinement does not confine a path within the origin: /api/config passes every confinement check and resolves to a recorder's configuration document, camera credentials included. An event id is therefore checked against a closed set (letters, digits, ., _ and -, one to 128 characters, never dots alone) at the HTTP route, before any device lookup, answering 400 and naming no device; and again inside the media origin when the path is composed, which protects in-process callers that do not sit behind the route. Percent-escaping instead would be the identity function, since every accepted character is unreserved. A template must contain the event-id placeholder ahead of any fragment, or a plugin could declare the configuration document as its event-snapshot template.

The cookie-only filter excludes exactly one thing: a request carrying Authorization: Bearer. The phone is not excluded: the mobile app authenticates with the shared session cookies and sends no Authorization header, so it reads event media as a browser does; the app's only camera surface is the live embed. A bare link pasted into a mail or opened where nobody signed in does not work. Making that work would need a scoped, short-lived media token, the one design that puts a credential in a URL, and it is deliberately not built. Dropping the cookie-only filter is not that design either: it would open every camera route to any personal access token carrying the device scope.

The files live on the plugin's own retention, so a link opened a week later fetches a 404 from the workload, restated as a gateway error in the shared media wording. The workload behaved correctly and the message blames it; this is accepted.

The plugin decides how narrow its own surface is

A camera plugin returns a media origin (base URI, per-transport rooted paths and request headers) and the host proxies exactly that. The restreamer's own configuration API is never published: it can add stream sources, and a source can be an arbitrary command line. Reeve renders no network policy between workloads, so a port on the pod network is a port every co-resident workload can reach.

The workload instead serves a couple of read-only media routes behind a token it received over the session plane, which the plugin repeats in the origin headers. A workload that authenticates the host is the difference between "the browser cannot reach the camera" and "nothing but Reeve can".

Every listener in a camera or recorder image binds to loopback except the media port

Absence of declared ports buys no isolation: the pod IP is routable, and a recorder's internal admin port can rewrite its configuration and run a transcoder.

A workload with no declared port is unreachable in a cluster

A workload with no declared ports gets no service object on the orchestrated provider, yet its DNS name is computed from the stored row and resolves fine, so the failure surfaces as a refused connection. The same plugin works on a container bridge, where every container gets a name. A plugin can pass locally and be unreachable in a cluster. On the Docker provider the backend must join the workloads' shared network: this is traffic from backend to workload, and a backend outside that topology has no configuration that reaches one.

Credentials and addresses are not device state

The canonical camera record carries state only. Device state is persisted and broadcast over the realtime hub to everyone with access, and a stream URL can carry credentials, so transport is negotiated by a separate endpoint and resolved in-process.

  • The credential lives in its own sensitive field, never in the stream URL. A URL containing a userinfo part is rejected with a message that does not echo it, and the credential is injected into the source URL only inside the container, percent-escaped, at the moment of the loopback call.
  • Only rtsp:// and rtsps:// are accepted stream schemes.
  • Credentials never appear in device state, logs, diagnostics or anything returned to a client, and command payloads carrying them are never logged.
  • A camera password is not trimmed. Every other optional field is trimmed, and blank means absent.

One plugin instance is one camera

Each camera is a separate instance of a camera plugin, and therefore its own workload container and its own canonical device. A manifest's workload array is static and has no "one per discovered device" kind, while many instances of one plugin type run side by side. One instance holding a list of cameras would need a list field, a separate credentials flow and shared failure. Configuration stays a flat set of fields and one camera's failure is isolated to its own container and health check, at the cost of one container per camera; a restreamer opens no connection to the camera while nobody watches and idles at a few tens of megabytes. Device identity derives from the plugin instance, never from the URL or the display name, or every rename forks a second device and loses its history.

Snapshots are transcoded in the workload

The camera workload image carries the decoder and serves single JPEG frames; the backend only forwards bytes. A single frame from a compressed source is a transcode, and a decoder in the core image would make every deployment carry it, including ones with no camera. A camera plugin whose image lacks a decoder has no snapshot, and both the phone preview and dashboard thumbnails rest on the snapshot.

Live video is fMP4 over a WebSocket

The picture is carried by a WebSocket under /api, and the client feeds the bytes to MediaSource itself so it can stay at the live edge. Progressive <video src> is not used: the element plays from its first byte at 1x forever, so every stall becomes permanent lag, and an Android WebView shows nothing over the same URL.

The socket takes a viewer slot on the same budget and gives it back the same way. Its first frame is text and names the MIME types to try; everything after it is binary media, chunked wherever the network cut it. The socket is accepted only once the plugin has a session, so a refusal reaches the viewer as an HTTP status and a sentence; nothing may escape after the 101. A socket waits fifteen seconds for a usable stream header, then six seconds more for in-band parameter sets before settling for the container's own description.

The client owns the live edge

It trims what it has played, speeds up slightly to close a small gap and seeks only when the gap is large enough that a visible jump is the lesser cost. Latency is roughly half a second to two seconds, dominated by the camera's key-frame interval; what matters is that the lag is bounded and self-correcting rather than cumulative.

The codec description is read from the in-band parameter sets

Neither obvious source of the codec string can be trusted. For an Aqara G5 behind go2rtc, the response advertises avc1.640029 (High 4.1), the moov declares a 128x96 Baseline level 1.0 track carrying a seven-byte placeholder SPS, and the samples are 2688x1520 Main level 5.0. The parameter sets carried in-band ahead of the first keyframe are the only description that matches what the decoder will see, so the backend reads them, rewrites the init segment to agree with them and sends the client an ordered list of MIME types. Under-declaring a level is the one direction a browser may refuse outright. The rewrite is also what makes the aspect ratio right: a browser takes its display aspect from the container.

There is no playlist transport

There is no playlist route, no playlist field in the transport response and no playlist path on the plugin-supplied origin. Every URI in a playlist is relative, so a byte-for-byte proxy points the player at segment routes the backend does not serve. Supporting one would need playlist rewriting, a token-resolved segment route under the same origin confinement, segment caching that contradicts no-store, and a viewer-slot model keyed to a session rather than a request. Do not declare a transport the host will silently ignore: the socket covers every browser the front end ships for, and the snapshot covers the rest.

A peer connection is a separate transport

A negotiated peer connection is the lower-latency route, and no byte of its media passes through the proxy. It cannot ride the HTTP ingress, so reaching it from outside the home needs the shared media plane's one published port. camera-webrtc-signalling.md covers that transport, including the case where the plane is the viewer's peer.

The shared media plane

The shared media plane is an optional media server (MediaMTX) the operator deploys for the whole installation. A plugin says where the plane may pull one of its cameras from, the host registers the camera on the plane and relays the viewer's negotiation with it, and a camera the plane cannot take keeps the transport it already had. How it works is in Media plane; running it is in the operator guide.

Proxy and plane HTTP clients bypass the SSRF guard

The camera proxy client and the media-plane control and remux clients do not register with the guarded outbound handler described in Every outbound client is guarded. That guard refuses private ranges, and a workload's ClusterIP or a plane address on the pod network is exactly that. The origin is the owning plugin's or the operator's to name, confined by the origin rules above, with redirects disabled. What this exposes, and why it is accepted, is on network egress and known limitations.

Motion

Camera motion is an event with a hold, decided once per camera at one gate

Any plugin sends camera.motionDetected ("motion now") onto a camera at least every 2 seconds while motion lasts: the owner through its event sink, any other plugin through the event contribution under devices.events.write. For a camera whose own plugin reports camera.motion as state, the host's ingest sends the same heartbeats while that source's accepted state says true, with one repeater per source. A repeat reads the camera from the device's cached ingest view and looks the source up in the database only when that view no longer lists it, so a source moved to another device repeats onto that device and a deleted device ends the repeater. One motion gate handles every heartbeat and keeps a per-camera Redis key for the motion stretch, which expires 6 seconds after the last heartbeat from any source (two lost repeats). A counted stretch is announced by two host-published device events, camera.motionStarted and camera.motionStopped, carrying the stretch id, so the feed, the "Camera — motion" trigger, the badge push and the event history see one pair per stretch. An event with a hold needs no writer order, version, relay or validity rule: a source that dies, goes offline, is disabled or is detached stops sending, and its motion ends 6 seconds later. No rule reads which plugin sent a heartbeat; see A camera event's source does not matter.

camera.motion state stays what the owning plugin reports. The device page, the phone's camera sheet, the Matter bridge and StateChange triggers on camera.motion show the owning plugin's sensor only; motion from any source shows in the dashboard badge, the event history, the motion trigger and the baby monitor, which reads the gate key. A camera whose owner declares no motion gains no capability. Because the state adapter is not opt-in, a "DeviceEvent, any event" trigger on a camera whose own plugin reports motion fires on both edges of every stretch. Heartbeats never appear on the event feed, where such a trigger would fire every 2 seconds.

A stretch is opened, extended and closed atomically in Redis

Redis holds the only state, every store method throws when Redis does not answer, and an undecidable heartbeat is dropped. A stretch's expected end only moves later (XX so none precedes the opening, GT so a repeated opening cannot pull it back, NX so a new key gets a lifetime), and of two concurrent openers one wins. A new stretch is always announced; waiting up to a second for the previous close is only a courtesy to edge order. When the replica that started a run's key could not open its stretch (the opening failed before its started event reached the device-event feed, or the start itself got no answer after the key may have been written), it remembers that stretch for the camera, replacing any it remembered before, and its next heartbeat that finds the same run still going opens it then, with the run's first onset; a heartbeat that starts a new run forgets it. The next heartbeat does not repeat an opening whose started event reached the feed; when only marking it announced failed, the closer publishes the start again before the stop. The stop is published by whoever closes the stretch: normally the announcing replica on a local timer; if it died, the next stretch's opener or a 30-second probe of the gate's index of open stretches, which every replica runs on every deployment, after a 10-second grace so the owner's timer goes first. A per-stretch claim admits one closer and a dead closer's claim lapses after a minute; a failed close is retried with backoff (1 s doubling to 30 s). The gate key, not the index score, decides whether a stretch ended; an index member without a record gets no stop, nor does a deleted camera, and the closer does not depend on the database (when it cannot answer, the camera counts as existing). Delivery is at least once, and a repeated edge carries the same identity, which the trigger deduplicates. Re-arm timings have a one-second floor against clock skew, and gate, opener, closer and probe share one wall clock, not the workflow clock.

While Redis is unreachable there is no camera motion

Heartbeats are dropped, no stretch opens or closes, and automations and the baby monitor see none; no per-process fallback copy exists, because one would hide continuous motion from the baby monitor once taken. A stretch open when the outage began is closed by the probe once Redis answers, so motion spanning the outage shows as a late stop and a new start. The rule is Redis runs no server-side code applied with native commands only.

A pan-tilt-zoom move suppresses motion

A stretch that starts inside the camera's pan-tilt-zoom quiet window (PtzQuietSeconds, 10 seconds after the last move signal by default, 0 to turn it off) is masked until it lapses and publishes neither edge; motion that starts during a move and does not pause for 6 seconds is held back until it does. A move opens, or extends to the quiet time after now, a per-camera window; a lagging report never shortens a held window, and a backend fault never prevents the move. A move is a pan or tilt change strictly larger than 0.5 degrees (smaller steps are polling jitter); a position member absent on either side is no change; a preset that appears counts as a recall only when the replaced row carried state. For a source that reports only a moving flag the flag alone speaks, and a flag stuck true counts as one change. The window is half-open (From <= t < Until).

A Frigate motion heartbeat lives only as long as the MQTT session that delivered its ON

The frigate-events plugin, with ReportMotion on, stops every heartbeat of a Frigate when it detects a reconnect, and restarts one only on a Frigate ON or a camera_activity answer with motion true. An answer never stops a heartbeat, and nothing asks periodically. Frigate publishes its debounced motion only as the QoS-0, non-retained motion edge, so a lost OFF can happen only across a session break; camera_activity.motion follows the last frame, so stopping on it would cut real intermittent motion. Motion spanning a broker reconnect is under-reported until the next positive sample or ON, and a reconnect the plugin cannot detect can leave a heartbeat until Frigate's next OFF.

Detections travel as events

Object detection, plate recognition, zone events, doorbell presses and chime playback are emitted on the device-event channel with their detail on the payload, not as state, so they do not write a time-series row per frame. History keeps the payload detail, so a projection that drops fields on the history path is a defect. A recognised plate is its own event rather than a richer object detection, because recognition resolves after the detection; it is canonical-only and has no Matter counterpart.

Detection and plate events carry the camera's own event id, which builds the links to that detection's snapshot and clip and tells two detections apart in the fire-dedup key. Two dedicated camera trigger types read these events; the generic device-event trigger's picker keeps its scene-controller filter, which every existing button automation depends on, so it is not widened to cameras. Detection projection runs before deduplication, or a message refused as a false positive consumes the tracked object's identity and swallows the corrected follow-up.

The canonical camera type

The camera record is a superset of the Matter camera state surface: 31 capabilities covering stream management, user-level pan/tilt/zoom, zone management and chime, plus three Reeve-only members (stream state, motion, motion detection). Every field is optional. Per-instance ranges and lists (pan/tilt limits, zoom maximum, preset count, installed chime sounds, zone counts) live in the availability descriptor. Zone geometry is plugin configuration, and stream-session plumbing attributes are outside the record because the transport endpoint owns them. The record carries no generic vendor-command key: one that accepts writes and drops them is worse than its absence, and canonical records are append-only, so adding one later breaks nothing.

Adding a camera attribute means the record, the generated artifacts for both languages, the conformance fixture and the bridge mapping; the cross-language coverage check fails otherwise. Do not ship a control ahead of the thing that would honour it; the descriptor is what says whether that thing exists. The vocabulary rules are in device-model.md.

The camera panel is driven by the descriptor

The camera panel renders every capability the per-instance availability descriptor declares: a control for each one the device calls controllable, a labelled value row for each one it does not, and nothing for a capability it does not declare. Hand-built groups cover pan-tilt-zoom, privacy, recording, image, audio, detection, indicators and chime, and a generic arm dispatching on the capability's kind renders everything else, so the panel is total over the canonical type. The room and dashboard tiles keep the picture and gain at most two one-tap toggles.

No camera surface hardcodes a capability list

Two cameras in one installation expose different subsets, so a hardcoded control either does nothing or is missing.

Pan and tilt are absolute positions confined on the client

They are degrees with no canonical bounds and no relative or stop verb, so a direction button sends current + step and the client confines it to the declared range; the command endpoint rejects an out-of-range value rather than clamping it. Reported movement holds the local position in place and never disables the pad, since commanding a new target is the only way to interrupt a move.

Media availability never gates a control

A camera with no media plane at all still drives every capability it declares.

A numeric control renders the domain the endpoint enforces

That is the tighter of the canonical catalog's bounds and the instance's own. A producer whose declared range escapes the catalog has its bounds dropped at ingest, so a bound-less descriptor is the ordinary case, and an unbounded field would invite the value the endpoint rejects.

An optimistic rollback lives in the settled handler

Never in the mutation's error handler, whose mere presence opts the command out of the application-wide failure notice.

A camera's live picture starts on a tap

Each live stream or snapshot dials the camera, and the media proxy opens no connection while nobody watches. A tile that fetched a still would wake a battery or cloud camera and load every camera, every minute, for as long as a wall tablet sits on Start.

  • Start's camera tile is a placeholder with the camera's name, and motion and privacy on its state line; it asks the camera for nothing, neither a still nor a stream-info poll.
  • The Basic drawer, the dashboard camera widget (device and URL sources alike), the dashboard device widget and the room widget show a placeholder with one "Show live" button. The picture stops on "Hide live", when the fullscreen overlay closes or when the drawer closes. A device list card keeps its own "Show preview". Controls stay usable without the picture.
  • The Advanced device page, physical and logical, starts live, and so does the embed route that the phone's device sheet and a baby-monitor tile open: someone opened those to watch.

Exposure to Matter

The Matter bridge exposes a camera to Matter controllers as a snapshot-camera endpoint, or as the full camera type with WebRTC where the bridge's own WebRTC media module is enabled, and pulls the camera's media from the same proxy a browser uses, as a viewer that takes a viewer slot. How it does that is in Matter bridge; running it is in the operator guide.

Two postures for a third-party recorder

Posture What it is
Managed Reeve owns the recorder: its image, its configuration, its ports and a dedicated per-instance message broker.
External Attaches to a recorder the operator already runs, strictly read-only against it.

Workloads are always deployed, so a plugin with a workload cannot attach itself to an existing installation; the attach case is a workload-free plugin. Operators choose by ownership, not by feature. On the external side a viewer-level account is enough, and the two writable canonical fields travel over the recorder's documented set-topics on the broker, never through its API.

The managed recorder has its own broker

One camera's detection traffic never touches a broker the operator runs for other integrations, and the plugin works where that broker is configured differently or unreachable. The per-instance broker listens anonymously on the workload network, so the workload network is trusted.

The managed recorder's configuration is written from inside the pod

The adapter owns the file and applies changes through the recorder's merging config-set endpoint on loopback, while the plugin sends only intent over the session plane. The whole-file save endpoint would replace the document wholesale and race the operator's own edits; the merging endpoint locks the file, validates the result and rolls back on a parse error. Writing from inside the pod also keeps the plugin free of outbound traffic. Adding a camera is hot-applied; read the structured success field, never the response text, which claims a restart is required.

Recording belongs to the recorder

Recording, retention and review stay with the recorder. The general-purpose object store is for blob-shaped configuration, not media. The managed recorder's media volume is declared recoverable and pruned by its own retention; its configuration and event database volume is the critical one.

The strip that names what the picture is made of

In Advanced mode the device panel offers a row of chips in a popover behind an info icon on the picture: the rung (WebRTC/fMP4/Snapshots), the phase, which hop answered, the codecs both tracks settled on, and the candidate pair the media is on. Every chip is a measurement of the session on screen; a field nothing has measured yet is absent rather than blank.

  • The hop is stamped by the backend on the answer frame (via), because an answer from the plane and one from the camera behind it are the same shape.
  • The codecs on the negotiated rung are read from the answer's own media sections, so a track that ends up carrying nothing (a zero port, inactive, or never offered) reads as no audio rather than silence; on the fMP4 rung they come from the MIME type the browser accepted. Both are canonicalised to one spelling per codec.
  • The candidate pair comes from a getStats read when ICE reports the connection made, and again on recovery from a drop; a renomination mid-session raises no event, so this names the pair the session started on. Its local end says how the viewer reached its peer: host on the LAN, srflx or prflx through a NAT.

Basic mode, the compact tile and the embed route (the phone's surface) show none of it: a measurement nobody asked for reads as a fault.

Measured constraints

  • Concurrent viewers per camera default to three; event media to four, under its own key. Slots expire 30 seconds after the last renewal and a live viewer renews every 10.
  • An event clip has an end-to-end deadline of sixty seconds; an event snapshot shares the live snapshot's five. The proxy's connect timeout is five seconds.
  • A camera socket lags by roughly 0.8 seconds at the live edge; it speeds up by 8% above 0.8 seconds behind and seeks above 3 seconds behind, keeping 8 seconds of played video for the seek to land in.
  • MediaSource refuses a codec-less video/mp4 (Chrome 148), so the candidate list ends at video-only rather than at a bare container type.
  • The init-segment rewrite is what makes the aspect ratio right: the same stream renders 2688x1520 corrected and 2688x2016 uncorrected, whichever codec string it is given.
  • Adding a decoder to a musl-based runtime base costs about 11 MB; adding it to a glibc-based one costs about 577 MB across some 200 packages, and a musl-linked binary copied into a glibc image does not run. Serving media from the workload moves the image from the runtime base to the web base, about 40 MB.
  • The managed recorder's detect stream is pinned at 640x360, using under 2 MB of the 64 MB of shared memory a container gets by default. There is no shared-memory pod patch: that escape hatch is orchestrator-only and the container-provider validator rejects a workload declaring one. Raising the detect resolution requires re-measuring.
  • The managed recorder wants roughly one core and a gigabyte; its broker is negligible. Its base image is around 1.8 GB before Reeve adds a self-contained adapter of about 50 MB.
  • Motion threshold on both recorder paths is 1..255 where higher means less sensitive, published unchanged because inverting it would disagree with the vendor's interface and the value read back. Detection confidence is 0..1. A recorder's motion returns to false roughly 30 seconds after movement stops, on its own off-delay; camera motion through the gate ends about 4 to 6 seconds after a reporter's off-delay.

Behaviour that looks like a defect

Operator-facing symptoms are in troubleshooting. These are the ones a contributor meets:

Symptom Why
A stream fails and the interface cannot say why A failed socket carries no status into script, and a video element reports the same format error for the viewer limit, a dead workload and a corrupt stream. The preview sends one HEAD for the slot verdict, then one snapshot request for liveness, and branches on those.
A camera's picture is stretched vertically The init segment was not corrected. go2rtc synthesises a placeholder 128x96 track before it has the camera's parameter sets and never revises it, and a browser takes its display aspect from the container.
A camera stays on stills and says live video is not working Eight attempts at the live transport produced no frame, so the surface stopped attempting it: the client cannot play this stream. A reload retries, and so does a changed stream-info answer.
A live picture has no sound Every live rung mounts muted, because an unmuted element is refused by the autoplay policy; the device panel's speaker button appears only when the stream carries an audio codec, and the choice is held per picture (rung, stream generation and URL), so a replacement is silent from its first render. A room tile has no such button: it takes a still. Separately, MediaMTX carries Opus, G711 and G722 only, so an AAC camera is admitted to the plane without audio, which the strip names no audio.
A detection link opens in the browser and does nothing in the phone app Not authentication: nothing routes a URL into the app, because the App Link host is a compile-time constant a self-hosted operator cannot set. SendCameraNotification therefore carries the detection as fields instead of a link.
A detection link 404s for a camera whose live picture works That plugin declares no template for that transport; whether per-detection media exists is the plugin's answer.
A detection link that worked yesterday says the workload answered unexpectedly The plugin's own retention expired the file, and the upstream 404 is restated as a gateway error.

See also