Closed BleedFeed closed 1 year ago
i use a ffmpeg readableStream as input
const ffmpegProcess = spawn('ffmpeg',[ '-i','pipe:3', '-f','mp3', '-ar','44100', '-ac','2', '-codec:a','libmp3lame', '-b:a','128k', 'pipe:4'],{stdio:['ignore','ignore','ignore','pipe','pipe']}); ytdlStream.pipe(ffmpegProcess.stdio[3]); resolve(ffmpegProcess.stdio[4]);
below code works for hours without any issue
readable.on('data',async (chunk)=>{ shout.sync(); shout.send(chunk,chunk.length); });
but it's blocking so i've tried making it non-blocking like this
readable.on('data',async (chunk)=>{ readable.pause(); shout.send(chunk,chunk.length); const delay = shout.delay(); await new Promise((resolve)=>setTimeout(resolve,delay)); readable.resume(); });
this works until 8-9 minutes after that for some reason the stream ends and mountpoint gets destroyed. Is there a better way to read from a stream?
The problem was in the ffmpeg stream
Hey @BleedFeed, sorry for the late response. But I guess you have already solved the problem?
i use a ffmpeg readableStream as input
below code works for hours without any issue
but it's blocking so i've tried making it non-blocking like this
this works until 8-9 minutes after that for some reason the stream ends and mountpoint gets destroyed. Is there a better way to read from a stream?