FFMPEG works in command line but not in exec(&

2019-09-12 05:01发布

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. 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. Thanks in advance.

标签: php ffmpeg exec
2条回答
冷血范
2楼-- · 2019-09-12 05:28

Try

exec(/path/to/ffmpeg -i path/to/video.avi path/to/video.mpg);
查看更多
该账号已被封号
3楼-- · 2019-09-12 05:34

did you register your ffmpeg command as a PATH Environment variable in Linux / Windows ???? 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.

查看更多
登录 后发表回答