澳门银河网上官方赌场_老品牌值得信赖

ITKeyword,专注技术干货聚合推荐

注册 | 登录

解决PHP's exec() not executing command for FFmpeg

itPublisher 分享于

2020腾讯云双十一活动,全年最低!!!(领取3500元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1073

2020阿里云最低价产品入口,含代金券(新老用户有优惠),
地址https://www.aliyun.com/minisite/goods

I have installed ffmpeg on my server and it works fine via my terminal. I'm able to successfully convert a file to webm format, so I'm sure the installation is fine. I'm also sure that I only have one installation of ffmpeg installed on my machine.

A problem arises when I try to convert files through PHP via PHP's exec(). When I run the same commands, I ran in the terminal, nothing happens. I looked around stackoverflow and other parts of the net for some help. I tried this to see the output:

exec($cmd, $out, $rv);
echo "output is:\n".implode("\n", $out)."\n exit code:$rv\n";

The output is: "output is: exit code:127"

The command I'm using is in this format:

ffmpeg -i "sample.mov" -vcodec libvpx  -r 30 -b "644k" -acodec libvorbis -ab 128000   -ar "44100" -ac 2 -s "352x198" "sample.webm"

I've tried replacing "ffmpeg" with the full path to FFmpeg but that did not work.

Why isn't the script running the command correctly and converting the files?

Thank you!

php ffmpeg command exec
|
  this question
edited Aug 30 '11 at 6:34 Frankie 16.7k 7 52 94 asked Aug 30 '11 at 6:17 tundoopani 82 1 18 2   It's "¿Por qué?" (two words) ;-P –  Álvaro González Aug 30 '11 at 6:21      Search for ffmpeg status 127 error. Does your command run ok without php? –  xdazz Aug 30 '11 at 6:22      facepalm. Thanks, I forgot :p –  tundoopani Aug 30 '11 at 6:27      The command works perfectly in my terminal. –  tundoopani Aug 30 '11 at 6:28      Possible duplicate of stackoverflow.com/questions/4828083/ffmpeg-php-error-code-12??7 –  Bailey Parker Aug 30 '11 at 6:29  |  show more comments

2 Answers
2

解决方法

I have similar problem with ant target executions from php. I can't get whole output from ant command only first few rows and ant target was not executed. In other words is partial executed.

With bellow command I've managed to run it but output of the command is append to log_file.log.

$commandString = 'you_command_here >> log_file.log 2>&1 &';
$command = exec($commandString);

Hope this will work for you.


|
  this answer
edited Sep 16 '11 at 6:17 answered Aug 30 '11 at 6:42 glg 452 3 15

 | 

Error code 127 means the executable (ffmpeg) couldn't be found. Try specifying the whole path (you can that out find in your terminal with which ffmpeg) or compare the value of the PATH environment variable in your php script and terminal.


|
  this answer
answered Aug 30 '11 at 6:22 phihag 148k 36 285 331 1   "I've tried replacing "ffmpeg" with the full path to FFmpeg but that did not work." –  tundoopani Aug 30 '11 at 6:25

 | 


相关阅读排行


相关内容推荐

最新文章

×

×

请激活账号

为了能正常使用评论、编辑功能及以后陆续为用户提供的其他产品,请激活账号。

您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱

如果您没有收到激活邮件,请注意检查垃圾箱。

澳门银河网上官方赌场 <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <文本链> <文本链> <文本链> <文本链> <文本链> <文本链>