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) {