Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ffmpeg exited with code 126 #681

Closed
3 tasks
yangwenhaowenhe opened this issue Mar 24, 2017 · 8 comments
Closed
3 tasks

Error: ffmpeg exited with code 126 #681

yangwenhaowenhe opened this issue Mar 24, 2017 · 8 comments

Comments

@yangwenhaowenhe
Copy link

Version information

  • fluent-ffmpeg version: 2.1.0
  • ffmpeg version :ffmpeg-3.2.4
  • OS: CentOS release 6.8 (Final)

Code to reproduce

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)

Expected results

Observed results

Checklist

  • I have read the FAQ
  • I tried the same with command line ffmpeg and it works correctly (hint: if the problem also happens this way, this is an ffmpeg problem and you're not reporting it to the right place)
  • I have included full stderr/stdout output from ffmpeg
@yangwenhaowenhe
Copy link
Author

this is the error

error when transcoding audio: Error: ffmpeg exited with code 126
at ChildProcess. (/root/webapp/wenda/node_modules/fluent-ffmpeg/lib/processor.js:177:22)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)

@yangwenhaowenhe
Copy link
Author

any advice ?

@ionutale
Copy link

i get the same error. what is 126 code stand for ?

@pikitgb
Copy link

pikitgb commented Oct 14, 2017

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 ?

@verybluebot
Copy link

verybluebot commented May 1, 2018

I tried the same with command line ffmpeg and it works correctly

+1

@njoyard
Copy link
Member

njoyard commented May 5, 2018

Guys, the checklist is not there just for the looks. Please do what it says.

@verybluebot
Copy link

verybluebot commented May 7, 2018

@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

@deevannaveed
Copy link

For me this error was because of using wrong static build of Ffmpeg on Lambda, I had to use x86 instead of arm64 but you can also configure your lambda which architecture to use, for fluent-ffmpeg ffprobe is also required so don't forget to put it beside your ffmpeg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants