--- 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 ``/`