From c6087b990c1021fb83687c8e85e8025e543130cb Mon Sep 17 00:00:00 2001 From: Julian Cuni Date: Tue, 17 Nov 2026 12:48:50 +0100 Subject: [PATCH] wiki: camera live view decision; MJPEG install step; park-lab camera addresses vs 11-15 record Co-Authored-By: Claude Opus 5.5 --- wiki/concepts/lane-presence-and-anpr-entry.md | 2 + wiki/concepts/passage-confirmation.md | 17 ++- wiki/concepts/site-device-installation.md | 5 + wiki/decisions/camera-live-view.md | 114 ++++++++++++++++++ wiki/entities/lpr-camera.md | 4 + wiki/index.md | 3 +- wiki/log.md | 18 +++ 7 files changed, 159 insertions(+), 4 deletions(-) create mode 100644 wiki/decisions/camera-live-view.md diff --git a/wiki/concepts/lane-presence-and-anpr-entry.md b/wiki/concepts/lane-presence-and-anpr-entry.md index 6079980..5844c17 100644 --- a/wiki/concepts/lane-presence-and-anpr-entry.md +++ b/wiki/concepts/lane-presence-and-anpr-entry.md @@ -198,6 +198,8 @@ the actual booth PC to test on. - **Vision monitors the RTSP livestream continuously** for presence — rejected: rebuilds (worse) what the camera already does (presence), pegs the appliance CPU 24/7, and the leave-detection heuristic is no cleaner than a 30 s timeout. + (This is about *inference* on the stream. An operator **watching** a camera while a car is + present is a different thing, built 2026-11-17 — see [[camera-live-view]].) - **Vision polls every ~1 s to track THE car, segment a queue, count cars, read make/model** — a genuinely harder need (bumper-to-bumper cars the camera can't tell apart). Set ASIDE, not dismissed: it needs a general vehicle DETECTOR ([[opencv-anpr-service]] is plate-only today) + "same-car-vs-new" diff --git a/wiki/concepts/passage-confirmation.md b/wiki/concepts/passage-confirmation.md index c0a35ae..5e16f2b 100644 --- a/wiki/concepts/passage-confirmation.md +++ b/wiki/concepts/passage-confirmation.md @@ -107,17 +107,28 @@ Two cameras mounted on **one physical lane that serves both directions** (user, | | Entry camera | Exit camera | |---|---|---| | Address | `10.0.10.6` | `10.0.10.7` | -| Model | DS-2CD1043G2-LIU (4MP) | DS-2CD1083G2-LIU (8MP) | -| Sub-stream (102) | 640×360 H.264, 12.5 fps, keyframe every 4 s | 640×360 H.264, 20 fps, keyframe every 2.5 s | +| Model | DS-2CD1083G2-LIU (8MP, V5.8.4) | DS-2CD1043G2-LIU (4MP, V5.8.10) | +| Sub-stream (102) | 640×360 **MJPEG**, 12.5 fps (was H.264, keyframe every 4 s) | 640×360 **MJPEG**, 20 fps (was H.264, keyframe every 2.5 s) | | Line crossing / intrusion (`ISAPI/Smart/LineDetection`, `FieldDetection`) | `notSupport` | `notSupport` | | Motion detection | on, target `vehicle`, grid drawn | on, target `vehicle`, grid drawn | | Alarm server (`httpHosts`) | not set (`0.0.0.0`) | not set (`0.0.0.0`) | Read from the cameras over ISAPI the same day; bench snapshot results are on [[lpr-camera]]. +> **Addresses vs. the 2026-11-15 record (2026-11-17):** read again over ISAPI, `.6` answers as +> DS-2CD1083G2-LIU (8MP, V5.8.4, main 3840×2160 12.5 fps) and `.7` as DS-2CD1043G2-LIU (4MP, +> V5.8.10, main 2560×1440 20 fps) — every attribute swapped as a set against the 2026-11-15 bench +> table on [[lpr-camera]], so the two units most likely traded addresses between the bench and the +> park-lab mount. Directions hold (the OSD reads "Hyrje" on `.6`, "Dalje" on `.7`); the table above +> shows the current state. The same day both sub-streams were switched to **MJPEG** for the booth +> live view ([[camera-live-view]]): every frame is now a keyframe, so item 1's "≤ 1 s I-frame" +> concern no longer applies to these units; the watcher would decode MJPEG (OpenCV can) at +> ~300 KB/s per camera. + - The 8MP model has no line crossing either, so the constraint above holds for both: the booth PC does the tracking. -- Both sub-stream keyframe intervals are above the ≤ 1 s this design asks for (item 1). +- ~~Both sub-stream keyframe intervals are above the ≤ 1 s this design asks for (item 1).~~ + Moot since the switch to MJPEG (2026-11-17). - Neither camera pushes to park-lab yet, and neither is in its device registry. - [[k200l-printer]] records `10.0.10.7` as the park-lab printer's fixed address — the exit camera now answers there. To be resolved with the user. diff --git a/wiki/concepts/site-device-installation.md b/wiki/concepts/site-device-installation.md index 5180c1f..f30e521 100644 --- a/wiki/concepts/site-device-installation.md +++ b/wiki/concepts/site-device-installation.md @@ -206,6 +206,11 @@ convention so far: `admin` / `admin123` on the first units (change per site and 2. **Streams:** the snapshot the app pulls MUST come from the **sub stream** (`102`) — the main stream's ISAPI snapshot returns **503 instantly, always, on this model**. Set the sub stream to the highest resolution the camera allows. + **Set the sub stream's video encoding to MJPEG** — the booth camera tiles stream it live + ([[camera-live-view]]); with H.264 the tile stays on the snapshot and says why. The `102` + snapshot still returns a JPEG after the switch (measured on the G2 line, 2026-11-17). + With the snapshot stream on Sub, its resolution is also the ANPR resolution (MJPEG on the G2: + 640×360, 640×480 or 1280×720). 3. **Event push:** Event → Motion Detection with the AcuSense **Detection Target = Vehicle** filter ON, "Notify Surveillance Center" on, then Alarm Settings → **Alarm Server** → `http://10.0.10.203/api/devices/hikvision//event`. The `deviceId` exists only after diff --git a/wiki/decisions/camera-live-view.md b/wiki/decisions/camera-live-view.md new file mode 100644 index 0000000..5d3fe56 --- /dev/null +++ b/wiki/decisions/camera-live-view.md @@ -0,0 +1,114 @@ +--- +type: decision +tags: [parking, camera, ui, booth, video, hikvision] +sources: [] +updated: 2026-11-17 +status: settled +--- + +# Camera Live View — Booth Camera Tiles + +The booth operator can open a small tile per camera from the [[device-status-monitoring|device +footer]] and watch that camera live while a vehicle is in front of it. **BUILT 2026-11-17**; +verified end to end against the two park-lab cameras through the real server and in a browser +(not yet in the [[desktop-shell-tauri|desktop shell]] — see *Not yet verified*). + +## What the user asked for (2026-11-17) + +- The camera chips in the footer are clickable; a click opens that camera's tile in the bottom + right, about 15 % of the screen wide. A second camera's tile stacks to the **left** of the first. +- A tile closes with ✕; which tiles are open is a **user preference** (restored on login). +- A tile rests on the **latest entry/exit snapshot** of that camera; when the camera's vehicle + events reach the booth, it shows **live video**. + +## Decision + +| Question | Choice | Why | +|---|---|---| +| Video source | The camera's **sub-stream (x02) set to MJPEG**, pulled over **RTSP** | The G2 firmware answers the HTTP MJPEG preview (`/ISAPI/Streaming/channels/102/httpPreview`) with `notSupport`; RTSP offers MJPEG as RTP/JPEG (RFC 2435). Every MJPEG frame is a whole picture, so a view is live ~150 ms after connect — H.264 would wait for a keyframe (every 2.5–4 s on these cameras) and need a decoder. | +| Where it runs | **In the server process**, as a driver capability (`LiveStreamDevice`) in `packages/devices` | No sidecar container (camera config + `localAddress` already live in the DB; the [[device-adapter-pattern]] keeps the protocol in the driver). The server reassembles JPEG frames from RTP packets — about 450 small packets/s for two cameras; it never decodes or re-encodes. | +| Fan-out | **One RTSP session per camera**, shared by every viewer, torn down 5 s after the last leaves | A camera has few stream slots and the [[lane-presence-and-anpr-entry|ANPR loop]] pulls stills from the same unit. | +| Delivery to the page | A **WebSocket per open tile** (`/api/cameras/:id/live`), one JPEG per binary message, **latest frame only**, capped at 10 fps per viewer | Works in the desktop shell, whose webview cannot carry the session cookie on an ``/`