i give up lol

This commit is contained in:
legop3
2026-01-17 20:35:03 -05:00
parent 87936510b2
commit 3a8bb8a0cf
@@ -107,10 +107,12 @@ 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 {
'-hide_banner', outputUrl,
'-loglevel', args: [
'info', '-hide_banner',
'-loglevel',
'info',
'-fflags', '-fflags',
'nobuffer', 'nobuffer',
'-flags', '-flags',
@@ -137,15 +139,23 @@ function buildArgs(source) {
`${bufsize}k`, `${bufsize}k`,
'-pix_fmt', '-pix_fmt',
'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;