当我运行ffmpeg命令时,它正在从命令行工作。但是当我尝试从PHP exec()
。它返回127错误。ffmpeg没有从php exec()函数运行,从命令行工作
我的ffmpeg
[email protected] [/]# which ffmpeg
/root/bin/ffmpeg
,这是我的代码
ffmpeg-y -i /home/castbox/public_html/IGVideo/upload/tamil/videos/testing/test_ig.mp4 -acodec libfdk_aac -ab 24k -ar 44100 -c:v libx264 -pix_fmt yuv420p -profile:v baseline -level 31 -b:v 200k -g 72 -f hls -hls_time 3 -hls_list_size 999 -s 426x240 /home/castbox/public_html/IGVideo/upload/tamil/videos/testing/test_ig-240-index.m3u8
when i run this code in from command line it work fine. but when try to run from php exec i am getting failed, it returns 127.
我曾试图这样也
/path/to/ffmpeg-y -i /home/castbox/public_html/IGVideo/upload/tamil/videos/testing/test_ig.mp4 -acodec libfdk_aac -ab 24k -ar 44100 -c:v libx264 -pix_fmt yuv420p -profile:v baseline -level 31 -b:v 200k -g 72 -f hls -hls_time 3 -hls_list_size 999 -s 426x240 /home/castbox/public_html/IGVideo/upload/tamil/videos/testing/test_ig-240-index.m3u8
哪里是我的错?
莫非是权限有关? – DarkUrse 2015-02-06 11:16:13
你的二进制文件位于'/ root /'目录中。网络服务器以不同的用户运行,并且很可能无法访问它。 – 2015-02-06 11:21:57
可能的重复:http://stackoverflow.com/questions/14403013/ffmpeg-works-in-command-line-but-not-in-exec-it-returns-127 (不知道如何添加重复的问题好的方法) – DarkUrse 2015-02-06 11:24:23