Skip to content

feat(cctv): open up to eight cameras at once, and analyze and watch them together - #521

Merged
simplifaisoul merged 1 commit into
masterfrom
feat/cctv-camera-wall
Nov 29, 2026
Merged

simplifaisoul merged 1 commit into
masterfrom
feat/cctv-camera-wall

Conversation

@simplifaisoul

Copy link
Copy Markdown
Owner

Summary

Clicking a camera on the map now adds it to a camera wall instead of replacing the one that is open. Up to eight cameras can be open at once. ANALYZE ALL and WATCH ALL 30S run on every readable camera together, and a totals strip adds up the results across the wall. OI Assist's camera tool can open and look through several cameras in a single call.

Changes

Camera wall

  • src/lib/camera-wall.ts holds pure helpers:
    • adding cameras: de-duplicated, capped at eight, with an optional make-room mode for OI;
    • choosing grid columns;
    • totalling looks across the wall.
  • src/components/CameraWall.tsx: a single camera keeps the existing viewer. Two or more become a grid of numbered tiles in 2, 3 or 4 columns, with ANALYZE ALL, WATCH ALL 30S, STOP ALL / ALL LIVE, fullscreen and close-all. Tiles keep their identity within one grid, so a playing or watched stream never remounts.
  • A ninth camera is refused with a notice; no camera the reader opened is closed to make room. Clicking a camera that is already open flashes its tile.
  • CameraViewer.tsx: the card body is split out as CameraCard, which gains a compact tile mode. The standalone viewer used by the cut-out view behaves as before.
  • CameraVision.tsx adds a compact report for tiles and a WallReport. It shows:
    • vehicles and people in view across the wall;
    • vehicles counted passing on live watches;
    • the busiest camera;
    • kinds and colours.
  • OsirisMap.tsx: each open camera is ringed in gold and labelled with its tile number (cctv-picked source).

Detector

  • vision/client.ts: the single detector worker becomes a small pool. It uses up to half the cores, at most four, and two on low-memory devices. Each camera stays on one worker for the length of a look, because its motion state lives in that worker.
  • vision/store.ts:
    • useLooks(ids) reads looks for several cameras at once.
    • showLook(id) stops a look once its tile closes. The stop is deferred, so StrictMode remounts survive.

OI Assist

  • The camera tool accepts ids (up to eight) or near + count, opens the cameras side by side and looks through them together.
  • The result reports totals, the busiest camera and a brief line per camera. Web-player cameras are skipped, and a camera that fails is reported without failing the call.
  • Up to four frames are attached for models that read images.
  • The protocol tells the model to make one call for several cameras rather than one call each.
  • The demo engine understands requests such as "watch 4 cameras near Wejherowo".

Testing

  • tsc --noEmit: clean.
  • vitest run: 1,848 passed, 27 skipped. This includes new tests for:
    • the wall helpers: add, de-duplicate, refuse a ninth, make-room eviction, columns, totals;
    • the OI camera tool: ids with one web player skipped and one camera failing, near + count, and four frames attached.
  • next build from a clean .next: compiled successfully.
  • Exercised end to end in Chrome against live HLS cameras in Pomerania, Poland:
    • Opened six cameras by clicking the map.
    • ANALYZE ALL found 31 vehicles in view across the wall.
    • WATCH ALL 30S counted 86 vehicles passing over six streams.
    • Filled the wall to eight; a ninth was refused with the notice, and re-clicking an open camera added no duplicate.
    • Closing a tile mid-watch stopped only that camera.
    • Checked the fullscreen grid and ALL LIVE.
    • In OI Assist, "watch 4 cameras near Wejherowo" opened and watched four cameras in one call.

🤖 Generated with SIMPLIFAI

…hem together

Clicking a camera on the map now adds it to a camera wall instead of
replacing the one open. One camera keeps the familiar viewer; a second
turns it into a grid of numbered tiles, up to eight, each with its own
Analyze and Watch. The map rings each open camera with its tile number.

- ANALYZE ALL and WATCH ALL 30S look through every camera whose picture
  can be read at once; a totals strip adds up what is in view, what the
  live watches counted passing, the busiest camera and the colours.
- A ninth click is refused with a notice, so a running watch is never
  closed for the reader; clicking an open camera flashes its tile.
- The detector runs on a small pool of workers (up to half the cores),
  each camera pinned to one, so several cameras are read in parallel.
- OI Assist's camera tool takes ids (up to 8) or near + count, opens
  them side by side and looks through them together, reporting totals,
  the busiest and each camera in brief; a model that reads images gets
  up to four frames.
@vercel

vercel Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
osiris Ready Ready Preview Nov 29, 2026 4:22am UTC

@simplifaisoul
simplifaisoul merged commit 02569f1 into master Nov 29, 2026
3 checks passed
RetroRix added a commit to RetroRix/GlassEarth that referenced this pull request Nov 30, 2026
…lifaisoul#521, part 1)

addToWall keeps the open cameras in open order, caps the wall at eight,
refuses a ninth (the page says so out loud) and, for OI, makes room by
closing the longest-open. The vision client now runs a small pool of
workers (one session pinned per worker) so several cameras can be looked
through at once; the store refcounts looks so a shared camera is analysed
once and forgotten only when the last viewer lets go. wallTotals drops
upstream's counted-passing sum: Glass Earth watches carry no such tally.
RetroRix added a commit to RetroRix/GlassEarth that referenced this pull request Nov 30, 2026
…#521, part 2)

CameraViewer splits into a thin solo wrapper and an exported CameraCard;
CameraWall lays the cards out (one camera renders exactly as the old
viewer did), each tile with its own feed, look and report. The page holds
the wall: map clicks, shared links, the dossier and OI add cameras;
roulette, Sunrise Chaser and the Theater Wall replace it solo, as the
single viewer behaved. The map rings the open cameras with their slot
numbers. Glass Earth extras (missions live-video, Listen to This Place)
are forwarded to every tile.
RetroRix added a commit to RetroRix/GlassEarth that referenced this pull request Nov 30, 2026
…aisoul#521, part 3)

The camera tool takes ids for up to eight cameras, or near + count for
the nearest few: they open on the reader's camera wall and are analysed
together; the model gets the totals, the busiest camera and each in
brief, and up to four frames are attached for vision models. Adapted to
Glass Earth: no passing tally exists in our watch summaries, so the
multi-camera summary reports in-view totals only.

This branch was successfully deployed

1 active deployment
Preview – osiris — 59c93fcf Deployed Nov 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant