Files
RTSP-Streamer/config.example.yaml
Levi Woodard 98ddf1645c Smoother daemon: no-op reloads, batched placement, muted audio, graceful teardown
- Skip stream restarts when a reload resolves to the identical wall
  (same URLs, tile geometry, player settings) — saving an unrelated
  config edit no longer blanks the screen.
- Replace per-tile placement polling (a swaymsg fork per tile per second,
  plus 150ms get_tree polling per tile at startup) with one shared loop:
  a single get_tree snapshot per tick, re-placing only drifted windows,
  relaxing to a 2s tick once settled.
- Mute streams by default (--no-audio) to skip an audio decoder per
  stream; opt back in with player.audio: true.
- Graceful, parallel mpv teardown via cmd.Cancel/WaitDelay, fixing the
  double-Wait race between Stop and Supervise and cutting worst-case
  layout switches from ~2s x N streams to ~2s total.
- status: probe mpv IPC outside the daemon mutex so a slow probe can't
  block layout switches.
- View sync: reuse the Protect session across ticks (re-login only on
  expiry) and pick up view_refresh_seconds changes without a restart.
- Health strikes keyed by player, not slot, so they never carry across
  layout switches; prune stale entries.
- New `rtsp-streamer reload` CLI; fix dead sort in `layout ls`; back off
  on persistent control-socket accept errors; fsync config before the
  atomic rename (SD-card power-cut safety); bump IPC client deadline;
  gofmt stragglers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 07:38:01 -05:00

89 lines
3.6 KiB
YAML

# Example rtsp-streamer config. Copy to ~/.config/rtsp-streamer/config.yaml
# (or point $RTSP_STREAMER_CONFIG at it) and edit. Keep secrets out of it by
# using password_env instead of an inline password.
controller:
host: 192.168.1.1 # UniFi OS console IP / hostname
username: viewer # a local Protect user with camera view access
password_env: RTSP_STREAMER_PASSWORD # read the password from this env var
verify_tls: false # UniFi ships a self-signed cert
rtsp_port: 7441 # Protect RTSPS port (default)
# Pin the render resolution, or leave empty to auto-detect from the connected
# output via sway.
display:
width: 1920
height: 1080
player:
hwdec: v4l2m2m-copy # Pi 4 hardware H.264 decoder. "auto-safe" often
# won't engage it; "no" forces software.
profile: low-latency
max_fps: 0 # cap rendered fps (0 = uncapped); trims render load
audio: false # streams are muted by default (saves CPU too);
# set true to decode and play camera audio
restart_backoff_seconds: 3
extra_args: []
# Camera catalog. Normally populated by `rtsp-streamer discover`; shown here
# by hand for illustration. Each camera can carry multiple stream qualities
# (high/medium/low) so a tile can choose which to pull. Layouts reference
# cameras by `name`. (A single `rtsp:` URL instead of `streams:` also works.)
cameras:
- id: 60a1b2c3d4e5f6 # UniFi Protect camera id (blank for manual entries)
name: Front Door
streams:
high: rtsps://192.168.1.1:7441/aBcD1234?enableSrtp
low: rtsps://192.168.1.1:7441/aBcD5678?enableSrtp
- name: Driveway
streams:
high: rtsps://192.168.1.1:7441/eFgH1234?enableSrtp
low: rtsps://192.168.1.1:7441/eFgH5678?enableSrtp
- name: Back Yard
streams:
low: rtsps://192.168.1.1:7441/iJkL9012?enableSrtp
- name: Garage
rtsp: rtsps://192.168.1.1:7441/mNoP3456?enableSrtp # legacy single-URL form
# Layouts place cameras on a base grid (COLSxROWS). Cameras are "tiles" that
# may span multiple cells, so you can mix a big main view with small side
# tiles. Up to 16 cameras per layout. Edit these interactively with
# `rtsp-streamer tui` (a live ASCII preview shows the arrangement).
layouts:
# Simple even grid: four 1x1 tiles on a 2x2.
- name: quad
grid: 2x2
tiles:
- {camera: Front Door, col: 0, row: 0}
- {camera: Driveway, col: 1, row: 0}
- {camera: Back Yard, col: 0, row: 1}
- {camera: Garage, col: 1, row: 1}
# Security-wall style: one big 3x3 main view (high quality) + a right column
# of three small tiles on the low substream to keep decode load down.
- name: main-plus
grid: 4x3
tiles:
- {camera: Front Door, col: 0, row: 0, colspan: 3, rowspan: 3, quality: high}
- {camera: Driveway, col: 3, row: 0, quality: low}
- {camera: Back Yard, col: 3, row: 1, quality: low}
- {camera: Garage, col: 3, row: 2, quality: low}
- name: front-focus
grid: 1x1
tiles:
- {camera: Front Door, col: 0, row: 0}
# The older one-camera-per-cell "slots" form still works and is upgraded to
# tiles automatically when you edit it:
# grid: 3x3
# slots: [Front Door, Driveway, Back Yard, Garage, "", "", "", "", ""]
active_layout: quad
# Re-sync the active layout from its linked UniFi Protect live view every N
# seconds (0 = off). Layouts created by `views import` carry a `protect_view:`
# and are re-synced when this is set. Requires the controller password at
# runtime (export RTSP_STREAMER_PASSWORD for the daemon).
view_refresh_seconds: 0