I used:
ffmpeg.setFfprobePath(ffprobeBin.path);
ffmpeg.setFfmpegPath(ffmpegPath);
ffmpeg(audioPath, {timeout: 432000})
.audioCodec('aac')
.audioBitrate('128k')
.outputOptions(['-hls_time 10', '-hls_list_size 0'])
.format('hls')
.output(`${folderPath}/${streamName}`).on('end', () => {
console.log(`Finished processed ${streamName} for video Id: ${folderName}`);
Audio.findByIdAndUpdate(nameFile.split('.')[0], {
streamUrl: streamName
}
but it's not working with my audio file (mp3). I think the reason is this mp3 file has image or copyright.
I tried other audio codecs (aac, libmp3lame), but it still does not work.
Use option map 0-a to pick sound in file;