转换使用ffmpeg没有exec [英] convert using ffmpeg without exec
问题描述
exec()
命令,就可以将flv转换成avi,反之亦然。这是可能吗? 谢谢。
编辑:
i希望有人可以编辑ffmpeg源并执行一个exec函数到php扩展,所以我们可以只是添加参数到一个函数(ex $ fmpeg-> exec('exec parameters here');),所以exec执行直接从扩展...
并编译这些文件:p
这是不可能的,至少在那里似乎没有一个例子,其中 ffmpeg
运行没有某种类型的系统调用(例如 exec
, system
)从PHP。
编辑:一个选项是使用可怕的 safe_mode
。请参阅 exec
:
注意:启用安全模式后,
只能执行
safe_mode_exec_dir中的文件。 ...
理论上,您可以将ffmpeg二进制文件放在任意目录中,并将该目录的路径设置为 safe_mode_exec_dir之
。这样用户只能在该目录中运行可执行文件。但是,您必须尝试在现实生活中看到这样的设置的含义...
关于您的PHP扩展请求:PHP ffmpeg扩展只是一个信息。如果您需要可以在实际文件上执行的操作,则需要根据 ffmpeg
库构建新的扩展。
如果您打算在共享主机上执行此操作,那么您最有可能不幸运。共享主机提供商的标准问题不会提供这样的视频功能。视频托管和处理需要专门的托管。
I have Windows XP, Apache, PHP 5.3 and ffmpeg working fine. I need to convert flv to avi or vice versa without using the exec()
command. Is this possible?
Thank you.
edit : i hope someone could edit the ffmpeg source and implement an exec function into the php extension so we could just add the parameters to a function (ex $fmpeg->exec('exec parameters here'); ) so the exec is executed directly from the extension ...
and compile those file :p
It's not possible, at least there seems no example where ffmpeg
runs without some type of system call (e.g. exec
, system
) from PHP.
Edit: One option is using the dreaded safe_mode
. Refer to the manual on exec
:
Note: When safe mode is enabled, you can only execute files within the safe_mode_exec_dir. ...
In theory you can place the ffmpeg binary in an arbitrary directory and give the path of that directory to the safe_mode_exec_dir
. That way users will only be able to run executables in that directory. But you must try and see the implications of such a setup in real life...
Regarding your PHP extension request: PHP ffmpeg extension is just an informational one. If you need one that can do things on actual files, you will need to build a new extension based on ffmpeg
library.
And if you plan to do this on a shared hosting, you are most probably out of luck. A standard issue shared hosting provider wouldn't provide video functionality like this. Video hosting and processing requires specialized hosting at best.
这篇关于转换使用ffmpeg没有exec的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!