1

Please, I am trying to convert an mpg file to flv with ffmpeg. I am using the php system() command to execute it. However, I get an error code of 126. Any idea of what that means? Here is my code: system($ffmpegPath. " -i ". $srcFile. " -b 4000k -maxrate 4000k -bufsize 1835k ". $destFile, $cmd_status)

Thanks. I discovered I was referring to the wrong ffmpeg binary. However, now that I am pointing to the right binary, I get an error of 127. Any help?

NaijaProgrammer
  • 2,892
  • 2
  • 24
  • 33
  • 1
    Can ffmpeg encode the same file if you run the command from the command line? – Joachim Isaksson Oct 14 '12 at 17:42
  • @Joachim, Yes it can. However, I am running it now on a centos server using php script. The configurations are all ok – NaijaProgrammer Oct 14 '12 at 17:45
  • Seems you don't have a library required to run the process, or the library can not be found in the system's `path`. – Stan Oct 14 '12 at 17:48
  • When you say I don't have the library, what actually do you mean? what other library is required besides the ones that are usually installed alongside the ffmpeg? – NaijaProgrammer Oct 14 '12 at 17:53
  • I can't guess this. You should run `ldd` against ffmpeg and make sure all listed libraries are accessible from the user account under which php runs. – Stan Oct 14 '12 at 18:13

1 Answers1

5

From the bash(1) man page:

If a command is found but is not executable, the return status is 126.

Make sure that you can execute the given binary.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358