php中的无法调用exec运作视频转化

WBOY
Release: 2016-06-13 12:01:44
Original
1006 people have browsed it

php中的无法调用exec运行视频转化 。
我在制作一个用户视频上传到服务器,然后通过运行exec来执行ffmpeg的操作,但是ffmpeg的命令。。例如,在cmd下面。运行 ffmpeg -i 1.avi 2.flv 是正常的,但是当在php中exec("ffmpeg -i ../1/1.avi ../1/1.flv");的时候,没有看到转换后的文件。应该是执行失败。请问该如何调用ffmpeg这个外部命令???? 
------解决方案--------------------
../1/1.avi ../1/1.flv

这个是啥?路径?确定路径正确。
------解决方案--------------------
exec("ffmpeg -i ../1/1.avi ../1/1.flv"); 改為絕對路徑試試

例如:
$source = dirname(dirname(__FILE__))."/1/1.avi";
$dest = dirname(dirname(__FILE__))."/1/1.flv";
exec("ffmpeg -i ".$source." ".$dest);

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!