I'm trying to extract audio from video. This code works well:
ffmpeg('1.mp4').output('1.mp3')
.noVideo()
.format('mp3')
.outputOptions('-ab','192k')
.run();
But if I read the file with a stream like this:
var video = fs.createReadStream('1.mp4');
var audio = fs.createWriteStream('1.mp3');
ffmpeg(video).output(audio)
.noVideo()
.format('mp3')
.outputOptions('-ab','192k')
.run();
The output file weighs 1KB and does not have anything in it.
How can I extract audio using streams?
from fluent-ffmpeg extract audio using streaming
No comments:
Post a Comment