我正在嘗試一個簡單的測試,以瞭解如何通過PHP轉換視頻與ffmpeg,因爲他們上傳到我的網站(到.mp4)。然而 我是失去了一些東西,因爲我的簡單測試無所事事....轉換視頻與PHP和ffmpeg
代碼(簡體)
$videoFile = '/home/xxx/public_html/dev/videos/1746/sample.avi';
exec("ffmpeg -i $videoFile -vcodec h264 -acodec aac -strict -2 /home/xxx/public_html/dev/videos/1746/test.mp4");
我也有trired
system("ffmpeg -i $videoFile -vcodec h264 -acodec aac -strict -2 /home/xxx/public_html/dev/videos/1746/test.mp4");
和
shell_exec("ffmpeg -i $videoFile -vcodec h264 -acodec aac -strict -2 /home/xxx/public_html/dev/videos/1746/test.mp4");
另外,如果我嘗試
echo exec('ffmpeg -formats');
我沒有得到任何輸出
以上都不是皈依的測試工作,並沒有創建test.mp4文件。 我有錯誤報告打開,但沒有得到任何錯誤。
任何建議將受到歡迎請
好,安裝在所有的ffmpeg?它是否在shell會話中起作用? – mario
我沒有shell訪問,但它安裝(好吧,我認爲),如果我嘗試echo('ffmpeg - 版本');我得到很多庫和版本號 – Ford
echo exec('ffmpeg -version');給我這個「libpostproc 51. 2. 0/51. 2. 0」 – Ford