ffmpeg不是从phpexec()函数运行的,请从命令行运行


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")