Node-fluent-ffmpeg: audio output stream error

Created on 9 Feb 2018  路  3Comments  路  Source: fluent-ffmpeg/node-fluent-ffmpeg

`
var ffmpeg = require('fluent-ffmpeg'),

fs = require('fs'),

write = fs.createWriteStream('./2.wav');

ffmpeg('./123.mp3').audioCodec('pcm_s16le')
.audioBitrate(128)
.audioChannels(1)
.audioFrequency(16000)
.pipe(write)
.on('error', function(err) {
console.log('An error occurred: ' + err.message);
})
.on('end', function() {
console.log('Processing finished !');
})`
events.js:182
throw er; // Unhandled 'error' event
^

Error: ffmpeg exited with code 1: pipe:1: Invalid argument

at ChildProcess.<anonymous> (D:\gitHub\redsBack\node_modules\fluent-ffmpeg\l

ib\processor.js:186:22)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

Most helpful comment

When using pipes, you need to tell ffmpeg which format you are using.
Just add .format('wav') and you should be good to go.

All 3 comments

When using pipes, you need to tell ffmpeg which format you are using.
Just add .format('wav') and you should be good to go.

Closing, @konnextv has the right answer.

Similar old issue with the same solution: https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/issues/337#issuecomment-62901962.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TomKaltz picture TomKaltz  路  5Comments

jsamos picture jsamos  路  6Comments

lk220203006 picture lk220203006  路  3Comments

judemorrissey picture judemorrissey  路  5Comments

Rubinhuang9239 picture Rubinhuang9239  路  3Comments