Add on-screen clock overlay (outlined text, configurable corner/timezone)
A small always-on-top mpv window renders the local time in a screen corner. Implementation notes: - Transparent lavfi canvas (color=...@0.0, --alpha=yes) so the camera video shows through; no new dependencies. If the compositor can't do alpha it degrades to a dark backing, still legible. - Time drawn as an ASS osd-overlay pushed over mpv IPC once a second: white fill + black outline (\bord), so it reads on both bright (day) and dark (night) scenes without sampling the picture. Formatting the text in Go avoids any filtergraph escaping. - Time computed with time.LoadLocation against a configured IANA zone (default "Local"), so it's correct regardless of the host clock's zone and handles DST. A bad zone name fails at startup. - Managed on the daemon's own context (survives layout switches); the daemon keeps it positioned and raised above camera tiles. ensureClock is a no-op when the clock config + resolution are unchanged, so a reload never disturbs it. Config: new `clock` section (enabled, timezone, format, corner, font_size, width, height, margin) with defaults and corner validation. Documented in README and config.example (shipped enabled, America/Denver, 24-hour w/ seconds). Tests cover corner geometry. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
21
README.md
21
README.md
@@ -155,6 +155,27 @@ wall — stream URLs, tile geometry, player settings — against what's already
|
||||
running and leaves the streams untouched when nothing material changed, so
|
||||
saving an unrelated edit never blanks the screen.
|
||||
|
||||
## Clock overlay
|
||||
|
||||
An optional always-on-top clock can be rendered in a screen corner:
|
||||
|
||||
```yaml
|
||||
clock:
|
||||
enabled: true
|
||||
timezone: America/Denver # IANA name; "Local" uses the system zone. DST auto.
|
||||
format: "15:04:05" # Go time layout (24-hour w/ seconds)
|
||||
corner: bottom-right # bottom-right | bottom-left | top-right | top-left
|
||||
```
|
||||
|
||||
It's a tiny transparent mpv window (no extra dependencies) drawing the time as
|
||||
**white text with a black outline**, so it stays readable over both bright (day)
|
||||
and dark (night) camera scenes without measuring the picture. The time is
|
||||
formatted in the configured timezone via Go's zone database, so it's correct
|
||||
regardless of the host clock's zone and handles DST on its own. The daemon keeps
|
||||
it positioned and on top across layout switches. Size (`width`/`height`),
|
||||
`font_size`, and edge `margin` are configurable; enable/disable or retune it
|
||||
live with an edit plus `rtsp-streamer reload`.
|
||||
|
||||
## UniFi Protect live views
|
||||
|
||||
Copy a saved Protect "Live View" (its cameras and grid) straight into a layout:
|
||||
|
||||
Reference in New Issue
Block a user