当我运行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
我的错误在哪里?
答案 0 :(得分:0)
使用system()
代替exec()
尝试以下代码:
use system("ffmpeg -i input.wmv -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -preset slow -crf 22 -movflags +faststart output.mp4")