snapshot_history.py — async periodic capture per instance:
interval_sec / keep_last (FIFO eviction) / dir configurable
GET /snapshots/{instance}?limit=N → list metadata
GET /snapshots/{instance}/{filename} → image bytes
Persisted в /var/lib/cuda-grid/snapshots/{instance}/<ts>.png
layout_map / layout_filter_target в InstanceCfg — для будущей runtime switch
архитектуры (через streamselect либо filter rework — выбор за Phase 7).
Текущий _set_layout dispatches к layout_filter_target c index из map.
UI:
+ Layout buttons (quad/single/main_plus_preview placeholder)
+ Snapshot history grid с thumbnails (loaded /snapshots/{inst}?limit=24)
+ "Reload history" button
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Static HTML/JS dashboard в cuda_grid_controller/static/index.html, mounted
на /ui и / FastAPI endpoints. Vanilla JS + HLS.js (CDN) для video player.
Controls:
Audio source — buttons из /audio/{instance} list, switch через POST
Intercom — Start (music↓) / End (restore)
Snapshot — opens PNG в new tab
Manual overlay — form для rect/text/dim/icon types
Chat — placeholder (info-toast про mosquitto_pub)
State — refresh каждые 2 sec, shows layout/overlays_count + raw list
Player consumes HLS на http://server:8888/live/index.m3u8 (mediamtx).
TV не нужен — браузер на любом устройстве в LAN.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
InstanceCfg.audio_zmq_endpoint (optional) — ZMQ адрес отдельного audio
sidecar ffmpeg. dispatcher._audio_set + _intercom_set теперь используют
_audio_client(inst) — separate ZMQ socket к sidecar.
Fallback: если audio_zmq_endpoint=null → реверт к video pipeline zmq
(Phase 5a single-source behaviour).
Зачем: multi-source audio chain в одном pipeline с video блокирует
video pacing (см. feedback_audio-chain-blocks-video). Split разделяет
A/V на 2 ffmpeg процесса; audio sidecar publish'нет к mediamtx, video
pipeline consume'нет audio как RTSP source + remux к combined output.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
User feedback: 4px motion border слишком жирная, к тому же много false motion
от Frigate (зоны/чувствительность будут tune'иться позже). Уменьшаем default
до 1px чтобы borders не мешали visually. Width конфигурируется (1..16).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Frigate publishes на /motion/state ("ON"/"OFF") — а bare /motion это SET-topic
для control. Subscribe pattern был неправильный → bridge не получал motion events
→ red border не загорался при motion.
Live verified после fix: real motion от parking/gate_lpr/back_yard cameras
триггерит upsert cell_<N>_border с motion theme (red #FF0000, 4px, opacity 1.0).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Permanent 1-2px рамка вокруг каждой cell для visual разделения.
При motion ON → рамка светится красным (config'и BorderTheme).
Logic:
_ensure_borders() Lazy init 4 borders (id="cell_N_border") при первом event
с idle стилем (#808080 width=2 opacity=0.4)
_set_border_state(motion=bool) Upsert тот же overlay с motion (#FF0000 width=4 opacity=1.0)
или idle styling
_cell_states set'у активных cams per cell ("inst:cell" → set(cam_names))
— border ON если хоть один cam имеет motion, OFF только когда
все cams cleared
BorderTheme:
idle_color/width/opacity subtle разделитель
motion_color/width/opacity alarm подсветка
configurable через cfg.frigate.border_theme
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Filter использует sscanf("%s") который stops on whitespace — нужно
URL-encode string values (text="hello world" → text=hello%20world).
Filter inline decode'ит %xx.
Также:
tools/smoke_test_overlays.sh — integration test script (manual run
утром когда GPU свободна; сейчас прод-сервисы заняли всю VRAM)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>