gpt4 book ai didi

php - 建议 fatal error : Uncaught exception 'Alchemy\BinaryDriver\Exception\ExecutableNotFoundException' with message 'Executable not found,

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

我已经安装了https://github.com/PHP-FFMpeg/PHP-FFMpeg在 Linux 上

托管路径是

/public_html/videoconversion/

我遇到了这个错误。

Fatal error: Uncaught exception 'Alchemy\BinaryDriver\Exception\ExecutableNotFoundException' with message 
'Executable not found, proposed :
public_html/videoconversion/' in
/home/deveducate/public_html/videoconversion/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/AbstractBinary.php:160 Stack trace:
#0 /home/deveducate/public_html/videoconversion/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php(48):
Alchemy\BinaryDriver\AbstractBinary::load('public_html/vid...', NULL, Object(Alchemy\BinaryDriver\Configuration))
#1 /home/deveducate/public_html/videoconversion/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(226): FFMpeg\Driver\FFProbeDriver::create(Array, NULL)
#2 /home/deveducate/public_html/videoconversion/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php(117): FFMpeg\FFProbe::create(Array, NULL, NULL)
#3 /home/deveducate/public_html/videoconversion/convert_to_mp4.php(10): FFMpeg\FFMpeg::create(Array, NULL)
#4 {main} Next exception 'FFMpeg\Exception\ExecutableNotFoundException' with message
'U in /home/deveducate/public_html/videoconversion/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Driver/FFProbeDriver.php on line 50

文件

require 'vendor/autoload.php';
$ffmpeg = FFMpeg\FFMpeg::create(array(
'ffmpeg.binaries' => '/opt/local/ffmpeg/bin/ffmpeg',
'ffprobe.binaries' => '/opt/local/ffmpeg/bin/ffprobe',
'timeout' => 3600, // The timeout for the underlying process
'ffmpeg.threads' => 12, // The number of threads that FFMpeg should
use
), $logger);
$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')

谁能告诉我在哪里更新路径。

谢谢

最佳答案

根据 documentation :

FFMpeg will autodetect ffmpeg and ffprobe binaries. If you want to give binary paths explicitly, you can pass an array as configuration.

例子:

$ffmpeg = FFMpeg\FFMpeg::create(array(
'ffmpeg.binaries' => '/opt/local/ffmpeg/bin/ffmpeg',
'ffprobe.binaries' => '/opt/local/ffmpeg/bin/ffprobe',
'timeout' => 3600, // The timeout for the underlying process
'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use
), $logger);

在您的代码中,您似乎需要在此文件中进行更改:

/home/deveducate/public_html/videoconversion/convert_to_mp4.php

注意:文档中也有说明,因此您可以将它们添加到系统路径中:

This library requires a working FFMpeg install. You will need both FFMpeg and FFProbe binaries to use it. Be sure that these binaries can be located with system PATH to get the benefit of the binary detection, otherwise you should have to explicitly give the binaries path on load.

关于php - 建议 fatal error : Uncaught exception 'Alchemy\BinaryDriver\Exception\ExecutableNotFoundException' with message 'Executable not found,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53966971/

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