PHP exec不执行FFmpeg命令 [英] PHP exec not executing FFmpeg command

查看:200
本文介绍了PHP exec不执行FFmpeg命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用php的exec来执行FFmpeg命令,但是当我在浏览器中打开它时,它不会唤醒。但是当我在终端运行这个php文件脚本它工作正常。我的php安全模式是关闭的。请帮我解决。我的php代码是

I have used php's exec to execute FFmpeg command but its not woking when I open it in browser. But when i run this php file script in terminal it works fine.And my php safe mode is off. please help me to get it solved. my php code is

    <?php
    $output=exec("ffmpeg -f image2 -i /home/phedra/imgs/image/img%03d.png -r 12 -s 610x489 /home/phedra/imgs/video/out.avi", $out);
echo $out;
echo $output;
    ?>


推荐答案

尝试给ffmpeg应用程序所在的完整路径。

try giving full path where the ffmpeg application is located.

例如

/usr/bin/ffmpeg

所以你的函数可能如下所示:

So your function might look like:

$output=exec("/usr/bin/ffmpeg -f image2 -i /home/phedra/imgs/image/img%03d.png -r 12 -s 610x489 /home/phedra/imgs/video/out.avi", $out);

您必须检查ffmpeg的位置。

You must check what is the location of "ffmpeg".

这篇关于PHP exec不执行FFmpeg命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆