I am trying to execute ffmpeg with php. I installed FFmpeg-php and the extension is in the modules directory and it displays in phpinfo. FFmpeg is working fine, since I can run the command in the terminal and output the video. However, when I try to run a command from php using the following script:
exec(ffmpeg -i input.avi output.avi);
But I get the error code "127".
The extension is loaded using:
$extension = "ffmpeg";
$extension_soname = $extension . "." . PHP_SHLIB_SUFFIX;
$extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname;
define('FFMPEG_LIBRARY', '/usr/local/bin/ffmpeg');
if (!extension_loaded($extension))
echo dl($extension_soname) or die("Can't load extension $extension_fullname\n");
I also tried to determine the location of the aboslute extension in the command:
exec(/usr/local/bin/ffmpeg-i input.avi output.avi);
Again, this works in the terminal, but still returns the same erro code using php exec ().
Does anyone have any ideas?
Thank.
source
share