I am facing a problem with the processing process. I use a real joint server in a digital hosting package of $ 10 and use cloud service from Amazon s3. The problem is when uploading a video, whatever the size of the video, whether its size is 1 megabyte or 2 Giga. After the upload process, the processing process starts to upload, there is no problem But when the processing process takes a very long time so that I cannot complete it, what is the solution to that, is there a problem for me or is this process normal? I use laravel-ffmpeg and through laravel queue I am cutting the video into several qualities I will attach the code to you below.
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