I've I've using fluent ffmpeg in order to convert my songs from webm to mp3 but ffmpeg uses so many resources and I really need to make a FIFO queue that will be converting max 5 songs at the same time and make all the other wait.
I am using nodejs. Could anyone help me with that fifo queue and how would fluent ffmpeg work?
I've seen some other questions here on stackoverflow about a queue for ffmpeg but they were asking in other languages, not javascript and they were using the ffmepg cli tool while I use fluent ffmepg
My code:
ffmpeg(stream)
.format("mp3")
.audioBitrate(req.query.quality ? req.query.quality : 256)
.on("end", () => {
console.log("finished:)
})
.pipe(res, { end: true });