我試圖實現
https://github.com/PHP-FFMpeg/PHP-FFMpeg
PHP-FFmpeg的先決條件
我複製的src/FFmpeg的文件夾,我的文件夾包括和努力讓我自動加載知道在哪裏可以找到一切。
的測試,我做了一個腳本,簡單地做:
$ffmpeg = FFMpeg\FFMpeg::create();
$video = $ffmpeg->open('video.mpg');
我得到:
Fatal error: Class 'Doctrine\Common\Cache\ArrayCache' not found in /var/www/php/include/FFMpeg/FFProbe.php on line 203
我的問題是:PHP-ffmpeg的需要學說,因爲未在規定文檔。我需要什麼版本?是否有其他先決條件?
我可以爲此創建一個新問題,但我不確定是否應該。我現在已經實現了PHP-ffmpeg。我正在使用Laravel,但是這對於這個問題應該是無關緊要的。我正在嘗試啓用進度監控。它的工作原理,但我需要傳入一個ID,所以我可以更新memcache中正確的密鑰。
$id = 12345;
$format->on('progress', function ($audio, $format, $percentage) {
//this works perfect, but doesn't tell me which item is being updated
Cache::put("progress", $percentage, .25);
//this does not work as I am unable to pass in $id, if I add it as the 4th argument above it will display the number of threads or something
//Cache::put("{$id}_progress", $percentage, .25);
});
我需要澄清「on」方法。我查看了https://ffmpeg-php.readthedocs.org/en/latest/_static/API/,無法弄清楚這種方法的工作原理。任何幫助,將不勝感激。
從[作曲家要求(https://github.com/PHP-FFMpeg/PHP-FFMpeg/blob/master/composer.json),它使用原則緩存組件等。 – Charles