From a22bda44a7ed34807ba907ec0676706f5b3ce84d Mon Sep 17 00:00:00 2001 From: Wild Dragon Dev Date: Wed, 3 Jun 2026 22:07:16 +0000 Subject: [PATCH] fix(recorders): set PRE_ROLL_SECONDS=1 for sdi/deltacast/blackmagic sidecars --- services/mam-api/src/routes/recorders.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/mam-api/src/routes/recorders.js b/services/mam-api/src/routes/recorders.js index 592bd7a..f5fe77f 100644 --- a/services/mam-api/src/routes/recorders.js +++ b/services/mam-api/src/routes/recorders.js @@ -276,6 +276,7 @@ function buildStandbyEnv(recorder) { `LIVE_DIR=${liveDir}`, `MAM_API_TOKEN=${process.env.CAPTURE_TOKEN || ''}`, `STANDBY=1`, + `PRE_ROLL_SECONDS=1`, ]; } @@ -699,6 +700,12 @@ router.post('/:id/start', requireRecorderEdit, async (req, res, next) => { if (dcCount) env.push(`DELTACAST_PORT_COUNT=${dcCount}`); } + // Framecache slot has been warm since the bridge started — 1s pre-roll is + // sufficient. Avoids a 5s startup lag on both on-demand and standby spawns. + if (['deltacast', 'sdi', 'blackmagic'].includes(sourceType)) { + env.push('PRE_ROLL_SECONDS=1'); + } + if (sourceType === 'srt' || sourceType === 'rtmp') { env.push(`LISTEN=${isListener ? '1' : '0'}`); if (isListener) {