简体   繁体   English

FFMPEG在命令行中工作,但在exec()中不工作,它返回127

[英]FFMPEG works in command line but not in exec(), it returns 127

The command is 该命令是

ffmpeg -i path/to/video.avi path/to/video.mpg

and it works fine from the command line. 并且在命令行中可以正常工作。 However, when I call it with PHPs exec() , the return value is 127, it doesn't seem to detect FFMPEG. 但是,当我使用PHPs exec()调用它时,返回值为127,它似乎无法检测到FFMPEG。 What am I doing wrong? 我究竟做错了什么? I'm in localhost and the safe mode is off, but I'm new to both FFMPEG and exec() , so it may be a noob mistake. 我在localhost中,并且安全模式已关闭,但是我对FFMPEG和exec()都是新手,所以这可能是一个菜鸟错误。 Thanks in advance. 提前致谢。

尝试

exec(/path/to/ffmpeg -i path/to/video.avi path/to/video.mpg);

did you register your ffmpeg command as a PATH Environment variable in Linux / Windows ???? 您是否在Linux / Windows中将ffmpeg命令注册为PATH环境变量? it seems that you did not set it as a PATH variable that's why you have to include full path to FFMPEG command so that it worked for you. 似乎您没有将其设置为PATH变量,这就是为什么必须包含FFMPEG命令的完整路径以便它对您有用的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM