gpt4 book ai didi

在 apache2 上安装 php-ffmpeg

转载 作者:行者123 更新时间:2023-12-04 22:58:38 28 4
gpt4 key购买 nike

尝试运行 PHP-FFMPEG 并通过 Composer 安装后,我目前得到了这个。

PHP Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutableNotFoundException: Executable not found, proposed : avprobe, ffprobe in /var/www/html/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php:159\nStack trace:\n#0 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php(48): Alchemy\BinaryDriver\AbstractBinary::load(Array, NULL, Object(Alchemy\BinaryDriver\Configuration))\n#1 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(226): FFMpeg\Driver\FFProbeDriver::create(Object(Alchemy\BinaryDriver\Configuration), NULL)\n#2 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php(117): FFMpeg\FFProbe::create(Array, NULL, Object(Doctrine\Common\Cache\ArrayCache))\n#3 /var/www/html/starapp/test.php(4): FFMpeg\FFMpeg::create()\n#4 {main}\n\nNext FFMpeg\Exception\ExecutableNotFoundException: Unable to load FFProbe in /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php:50\nStack trace:\n#0 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMp in /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php on line 50



有人建议运行以下命令:
$ffmpeg = FFMpeg\FFMpeg::create([
'ffmpeg.binaries' => 'usr/bin/ffmpeg',
'ffprobe.binaries' => 'usr/bin/ffprobe',
'timeout' => 3600, 'ffmpeg.threads' => 12
]);

但是我在 usr/bin 中没有 ffmpeg/ffprobe 文件,而且似乎无法在任何地方找到它们。

编辑:

FFMpeg 已安装。我重新启动服务器并重新启动 apache2,现在文件可见。现在得到这个:

PHP Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutableNotFoundException: Executable not found, proposed : usr/bin/ffprobe in /var/www/html/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php:159\nStack trace:\n#0 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php(48): Alchemy\BinaryDriver\AbstractBinary::load(Array, NULL, Object(Alchemy\BinaryDriver\Configuration))\n#1 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(226): FFMpeg\Driver\FFProbeDriver::create(Object(Alchemy\BinaryDriver\Configuration), NULL)\n#2 /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php(117): FFMpeg\FFProbe::create(Array, NULL, Object(Doctrine\Common\Cache\ArrayCache))\n#3 /var/www/html/starapp/test.php(11): FFMpeg\FFMpeg::create(Array, NULL)\n#4 {main}\n\nNext FFMpeg\Exception\ExecutableNotFoundException: Unable to load FFProbe in /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php:50\nStack trace:\n#0 /var/www/html/vendor/php-ffmpeg/php-ffmp in /var/www/html/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php on line 50

最佳答案

问题是路径

'ffmpeg.binaries' => 'usr/bin/ffmpeg',
'ffprobe.binaries' => 'usr/bin/ffprobe'

然而:
'ffmpeg.binaries' => '/usr/bin/ffmpeg',
'ffprobe.binaries' => '/usr/bin/ffprobe'

正在工作中。

关于在 apache2 上安装 php-ffmpeg,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60171767/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com