This commit is contained in:
legop3
2026-01-13 19:08:51 -05:00
parent 27c46b44b2
commit a6e7e683ba
+14 -1
View File
@@ -163,10 +163,23 @@ function spawnRecorder(source) {
outPattern, outPattern,
); );
} }
const proc = spawn(FFMPEG_BIN, args, { stdio: 'ignore' }); const proc = spawn(FFMPEG_BIN, args, { stdio: ['ignore', 'ignore', 'pipe'] });
const stderrChunks = [];
let stderrSize = 0;
proc.stderr.on('data', (chunk) => {
if (!chunk || stderrSize > 8192) return;
stderrChunks.push(chunk);
stderrSize += chunk.length;
});
recorders.set(key, { proc, source }); recorders.set(key, { proc, source });
proc.on('exit', (code, signal) => { proc.on('exit', (code, signal) => {
recorders.delete(key); recorders.delete(key);
if (stderrChunks.length) {
const stderrText = Buffer.concat(stderrChunks).toString('utf8').trim();
if (stderrText) {
logger.warn('Replay recorder stderr', { key, stderr: stderrText });
}
}
if (!shouldRecord(source)) { if (!shouldRecord(source)) {
return; return;
} }