dragonflight/services/mam-api/src
Wild Dragon Dev ef57900583 feat(recorders): always-on standby sidecars for deltacast, sdi, blackmagic
Sidecars now spawn at recorder CREATE time instead of /start time.
The container boots in STANDBY=1 mode (idle preview only, no ffmpeg master).
On /start, mam-api sends per-session params (CLIP_NAME, ASSET_ID, PROJECT_ID)
to the running sidecar via HTTP POST /capture/start — ffmpeg starts in <1s.
On /stop, mam-api calls HTTP POST /capture/stop — container stays alive in
standby, ready for the next take immediately.
Container is only killed on recorder DELETE.

This eliminates: Docker create/start overhead (~1-2s), bridge startup (~2-5s),
and pre-roll wait (~5s). Latency from 'record' click to first encoded frame
drops from ~10s to ~1s.

Changes:
- capture/src/index.js: boot in standby when STANDBY=1 env is set; still
  start idle preview (live thumbnail visible before recording)
- capture/src/routes/capture.js: POST /start accepts full codec params and
  asset_id in body (skips mam-api asset creation when asset_id provided)
- node-agent/index.js: handleSidecarStandby() + POST /sidecar/standby route;
  warms bridge at recorder create time
- recorders.js POST /: spawn standby sidecar after DB insert (non-fatal)
- recorders.js POST /:id/start: HTTP fast-path to standby sidecar; falls
  back to on-demand spawn if standby not available
- recorders.js POST /:id/stop: HTTP /capture/stop, keep container in standby
- recorders.js GET /:id/status: use port-based URL for local capture status
2026-06-03 21:59:33 +00:00
..
ampp feat: AMPP folder sync integration — pre-create folder hierarchy on upload, expose lookup endpoint for Script Task: client.js 2026-04-18 13:42:07 -04:00
auth fix(audit): critical security hardening and ops reliability fixes 2026-06-03 10:42:57 +00:00
db fix(scheduler): allow 'starting' and 'stopping' statuses in DB 2026-06-03 16:54:35 +00:00
middleware fix(playout): repair failover, authenticate scheduler self-calls, fix playlist walk + CasparCG consumer syntax 2026-05-30 14:51:35 +00:00
routes feat(recorders): always-on standby sidecars for deltacast, sdi, blackmagic 2026-06-03 21:59:33 +00:00
s3 fix(s3): land NodeHttpHandler request/connection timeout in main 2026-05-29 17:26:59 -04:00
tasks Revert "auth: top-to-bottom rework — local accounts, RBAC + client tag, audit log, env-bootstrap" 2026-05-27 03:28:05 +00:00
index.js fix(mam-api): selfHeartbeat writes last_seen_at so primary node isn't stale-failover-killed 2026-05-30 18:57:20 -04:00
scheduler.js fix(scheduler): orphan grace window must use recorder.updated_at not asset.updated_at — asset is created at recording START not STOP 2026-06-03 14:03:32 +00:00