i give up lol

This commit is contained in:
legop3
2026-01-17 20:35:03 -05:00
parent 87936510b2
commit 3a8bb8a0cf
@@ -107,7 +107,9 @@ function buildArgs(source) {
PREVIEW_TRANSPORT === 'rtsp' PREVIEW_TRANSPORT === 'rtsp'
? ['-f', 'rtsp', '-rtsp_transport', 'tcp'] ? ['-f', 'rtsp', '-rtsp_transport', 'tcp']
: ['-f', 'mpegts']; : ['-f', 'mpegts'];
return [ return {
outputUrl,
args: [
'-hide_banner', '-hide_banner',
'-loglevel', '-loglevel',
'info', 'info',
@@ -139,13 +141,21 @@ function buildArgs(source) {
'yuv420p', 'yuv420p',
...outputArgs, ...outputArgs,
outputUrl, outputUrl,
]; ],
};
} }
function spawnRecorder(source) { function spawnRecorder(source) {
const key = buildKey(source); const key = buildKey(source);
if (recorders.has(key)) return; if (recorders.has(key)) return;
const args = buildArgs(source); const { args, outputUrl } = buildArgs(source);
logger.info('Preview transcoder starting', {
key,
transport: PREVIEW_TRANSPORT,
codec: PREVIEW_CODEC,
inputUrl: source.inputUrl,
outputUrl,
});
const proc = spawn(FFMPEG_BIN, args, { stdio: ['ignore', 'ignore', 'pipe'] }); const proc = spawn(FFMPEG_BIN, args, { stdio: ['ignore', 'ignore', 'pipe'] });
const stderrChunks = []; const stderrChunks = [];
let stderrSize = 0; let stderrSize = 0;