我在处理过程中遇到了问题。我使用一个实际的联合服务器在$10数字托管套餐中,并使用来自Amazon S3的云服务。问题是在上传视频时,无论视频大小是1兆字节还是2吉字节,上传完成后,处理过程开始上传,没有问题。但是当处理过程需要很长时间以至于我无法完成它时,有什么解决办法,这是我的问题还是这个过程正常?我使用laravel-ffmpeg并通过laravel队列将视频剪切成多种质量,我会将代码附上。
public function handle()
{
//180p
$lowBitrate1 = (new X264('aac'))->setKiloBitrate(613);
//270p
$lowBitrate2 = (new X264('aac'))->setKiloBitrate(906);
//360p
$midBitrate1 = (new X264('aac'))->setKiloBitrate(1687);
//540p
$midBitrate2 = (new X264('aac'))->setKiloBitrate(2227);
//720p
$highBitrate1 = (new X264('aac'))->setKiloBitrate(4300);
//1080
$highBitrate2 = (new X264('aac'))->setKiloBitrate(7917);
FFMpeg::fromDisk('s3')
->open($this->movie->path)
->exportForHLS()
->onProgress(function ($percent) {
$this->movie->update([
'percent' => $percent
]);
})
->setSegmentLength(10)// optional
->addFormat($lowBitrate1)
->addFormat($lowBitrate2)
->addFormat($midBitrate1)
->addFormat($midBitrate2)
->addFormat($highBitrate1)
->addFormat($highBitrate2)
->toDisk('s3')
->save("public/Movies/{$this->movie->id}/{$this->movie->id}.m3u8");
}//end of handle