openvibers/openvibe.live Commits

Backfill: stand down VOD transcription while the live timeline is running

OP OpenVibers committed 18 Aug 2026 · 038c9de93b · 1 file, +10 −1

The timeline job decodes live audio continuously, and VOD backfill does not
share its serialisation (_txChain wraps generateVodTranscript, not the timeline
path). So both ran whisper simultaneously on top of the live x264 encode.
Measured on this 4-core box: load average 5.44.

VOD transcripts have no deadline at all, so pause them while a stream is live
and the timeline is enabled. They resume at full speed — and full thread count
— the moment the stream ends, which is also when there is CPU to spare.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xw6Sf5zzSALw8m93XNu5JE

Changes

ddiff --git a/server/ai/backfill-job.js b/server/ai/backfill-job.js
iindex b7b5caa1..609050de 100644
---- a/server/ai/backfill-job.js
++++ b/server/ai/backfill-job.js
@@@ -45,7 +45,16 @@ async function tick() {
// the live encoders.
let anyLive = false;
try { anyLive = ((db.getLiveStreams && db.getLiveStreams()) || []).length > 0; } catch { /* */ }
-- if (ai.transcriptionEnabled && ai.transcriptionEnabled()) {
++ // When the continuous timeline is running it is already decoding live audio
++ // constantly, and VOD backfill does NOT share its serialisation — so both would
++ // run whisper at once, on top of the live encoder. Measured effect on this 4-core
++ // box: load average 5.44. VOD transcripts have no deadline whatsoever, so simply
++ // stand them down until the stream ends; they catch up at full speed afterwards.
++ let timelineBusy = false;
++ try { timelineBusy = anyLive && require('./timeline-job').timelineEnabled(); } catch { /* */ }
++ if (timelineBusy) {
++ try { require('./transcribe').setLowPower(true); } catch { /* */ }
++ } else if (ai.transcriptionEnabled && ai.transcriptionEnabled()) {
try { require('./transcribe').setLowPower(anyLive); } catch { /* */ }
const batch = anyLive ? 1 : 2; // throttle while live, catch up faster when idle
try {