繁体   English   中英

ffmpeg不是从php exec()函数运行,而是从命令行运行

[英]ffmpeg is not running from php exec() function, work from command line

当我运行ffmpeg命令时,它是从命令行运行的。 但是当我尝试从php exec()尝试时。 它返回127错误。

我的ffmpeg

root@w1 [/]# 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

我的错误在哪里?

使用system()而不是exec()

试试下面的代码:

use system("ffmpeg -i input.wmv -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -preset slow -crf 22 -movflags +faststart output.mp4")

暂无
暂无

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

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