fs.chmod(config.ffmpegPath, 751, (err) => {
if (!err) {
ffmpeg.setFfmpegPath(config.ffmpegPath)
let stream = ffmpeg(request.get(`${config.down_voice_url}access_token=${token}&media_id=${media_id}`))
.noVideo()
.audioCodec('libmp3lame')
.on('start', function (commandLine) {
console.log('Spawned FFmpeg with command: ' + commandLine);
})
.on('error', (err) => {
console.log('error when transcoding audio: ', err)
})
.on('end', () => {
console.log('transcoding to mp3 success')
})
.pipe()
request.post({
url: config.storeFileUrl,
formData: {
value: stream,
contentType: 'audio/mpeg'
}
},
(err, res, body) => {
callback(JSON.parse(body).data.url)
})
}
})
(note: if the problem only happens with some inputs, include a link to such an input file)
this is the error
error when transcoding audio: Error: ffmpeg exited with code 126
at ChildProcess.
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
any advice ?
i get the same error. what is 126 code stand for ?
Hi guys getting this error in the AWS Lambda too, maybe is related to the fact that the node library can't find ffmpeg installed on the computer ?
I tried the same with command line ffmpeg and it works correctly
+1
Guys, the checklist is not there just for the looks. Please do what it says.
@njoyard I have read the FAQ, tried the same with command line ffmpeg and it works correctly
and this is the full error output:
Failed audioBitrate: Error: ffmpeg exited with code 126
at ChildProcess.<anonymous> (/Users/shulg/youtube-to-mp3/node_modules/fluent-ffmpeg/lib/processor.js:182)
at emitTwo (events.js:125)
at ChildProcess.emit (events.js:213)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200)
anonymous) | @ | bundle.js:19666
-- | -- | --
聽 | emitThree | @ | events.js:135
聽 | emit | @ | events.js:216
聽 | emitEnd | @ | /Users/shulg/youtube-to-mp3/node_modules/fluent-ffmpeg/lib/processor.js:424
聽 | (anonymous) | @ | /Users/shulg/youtube-to-mp3/node_modules/fluent-ffmpeg/lib/processor.js:433
聽 | (anonymous) | @ | /Users/shulg/youtube-to-mp3/node_modules/async/dist/async.js:473
聽 | next | @ | /Users/shulg/youtube-to-mp3/node_modules/async/dist/async.js:5315
聽 | (anonymous) | @ | /Users/shulg/youtube-to-mp3/node_modules/async/dist/async.js:958
聽 | (anonymous) | @ | /Users/shulg/youtube-to-mp3/node_modules/async/dist/async.js:473
聽 | next | @ | /Users/shulg/youtube-to-mp3/node_modules/async/dist/async.js:5315
聽 | (anonymous) | @ | /Users/shulg/youtube-to-mp3/node_modules/async/dist/async.js:958
聽 | (anonymous) | @ | /Users/shulg/youtube-to-mp3/node_modules/fluent-ffmpeg/lib/capabilities.js:519
聽 | handleExit | @ | /Users/shulg/youtube-to-mp3/node_modules/fluent-ffmpeg/lib/processor.js:170
聽 | (anonymous) | @ | /Users/shulg/youtube-to-mp3/node_modules/fluent-ffmpeg/lib/processor.js:209
聽 | emitOne | @ | events.js:120
聽 | emit | @ | events.js:210
聽 | _handle.close | @ | net.js:549
I am running this on an electron app (React)
ffmpeg-binaries: "^3.2.2-3"
fluent-ffmpeg: "^2.1.2"
this is -version out put installed globally on my machine (MAC)
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
also the path in my .bash_profile is correct:
export PATH=$PATH:/usr/local/bin/ffmpeg
please let me know if anything else is missing