[英]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.