我正在尝试创建一个在运行时用于FFmpeg视频压缩的进程。在我的本地系统中,它在30秒内运行。当我试图在服务器中运行它时,它在60秒后开始抛出一个超时错误。当我在服务器中手动运行该命令时,大约需要2分钟。我开始了解到php.ini中的一些配置需要修改。我尝试将该进程的配置更改为300秒。尽管如此,仍然会输出相同的超时错误。
The process "/usr/bin/ffmpeg -i '/var/temp/5e7de5a9de7c2/creme bulee-01-infuse
the cream and milk.mp4' -s 1668x2224 -c:a copy '/var/temp/5e7de5a9de7c2/compre
ssed/temp_creme bulee-01-infuse the cream and milk_1668x2224.mp4'" exceeded th
e timeout of 60 seconds.在php.ini中,我有以下配置:
max_execution_time = 300
max_input_time = 300如何停止进程超时?
发布于 2021-08-13 09:40:37
我也有同样的错误,您需要在FFMpeg::create中添加设置并使用FFMpeg::create
$ffmpeg = FFMpeg::create(
array(
'timeout' => 0, // The timeout for the underlying process
)
);
$ffmpeg->open($video_path);发布于 2020-03-28 05:46:40
php.ini中的max_execution_time指令不会影响手册中提到的外壳命令(有关详细信息,请参阅https://www.php.net/manual/en/function.set-time-limit.php )
我的猜测是,您使用的是Symfony\Component\Process\Process,因为默认情况下,它的超时恰好是60秒,并且您的错误消息看起来很熟悉。如果我是对的,请使用try increasing the timeout
$process = new Process($ffmpeg_cmdline);
$process->setTimeout(3600);
$process->run();https://stackoverflow.com/questions/60885585
复制相似问题