私はffmpeg
をダウンロードし、それをコンポーザーにインストールしました。基本的な使用法のコードを使用しようとすると、このエラーが発生します。 binフォルダには、ffmpeg
,ffplay
、ffprobe
のexeファイルがあります。また、私はc:ffmpeg\bin
の環境変数を設定しています。Windows上でphf ffmpegをインストール
Fatal error: Uncaught exception
'Alchemy\BinaryDriver\Exception\ExecutableNotFoundException' with message 'Executable not found, proposed : c:\ffmpeg\bin\binffprobe.exe' in C:\xampp\htdocs\core\vendor\alchemy\binary-driver\src\Alchemy\BinaryDriver\AbstractBinary.php:160 Stack trace: #0
C:\xampp\htdocs\core\vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\Driver\FFProbeDriver.php(48): Alchemy\BinaryDriver\AbstractBinary::load('c:\ffmpeg\bin\b...', NULL, Object(Alchemy\BinaryDriver\Configuration)) #1 C:\xampp\htdocs\core\vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\FFProbe.php(207): FFMpeg\Driver\FFProbeDriver::create(Array, NULL) #2 C:\xampp\htdocs\core\vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\FFMpeg.php(117): FFMpeg\FFProbe::create(Array, NULL, NULL) #3 C:\xampp\htdocs\core\demo2.php(9): FFMpeg\FFMpeg::create(Array) #4 {main} Next exception 'FFMpeg\Exception\ExecutableNotFoundException' with message 'Unable to load FFProbe' in C:\xampp\htdocs\core\vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\Driver\FFProbeDriver.php:50 Stack trace: #0 C: in C:\xampp\htdocs\core\vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\Driver\FFProbeDriver.php on line 50
これは私のPHPコードです。
require_once 'vendor/autoload.php';
$ffmpeg = \FFMpeg\FFMpeg::create([
'ffmpeg.binaries' => 'c:\ffmpeg\bin\binffmpeg.exe',
'ffprobe.binaries' => 'c:\ffmpeg\bin\binffprobe.exe'
]);
$video = $ffmpeg->open('video.mpg');
$video
->filters()
->resize(new FFMpeg\Coordinate\Dimension(320, 240))
->synchronize();
$video
->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(10))
->save('frame.jpg');
$video
->save(new FFMpeg\Format\Video\X264(), 'export-x264.mp4')
->save(new FFMpeg\Format\Video\WMV(), 'export-wmv.wmv')
->save(new FFMpeg\Format\Video\WebM(), 'export-webm.webm');`