Scenario
I upload a file, after that is done I use PHP-FFMPEG to convert the file to an mp4, this is the code I use for that:
$video = $ffmpeg->open($targetPath . '1.' . $extension);
$format = new \FFMpeg\Format\Video\X264();
$format->setVideoCodec('libx264');
$format->setAudioCodec('aac');
$format->setAdditionalParameters(['-preset', 'fast', '-crf', '24']);
$format->on('progress', function ($video, $format, $percentage){
$_SESSION['progress'] = $percentage;
});
$video->save($format, $targetPath . '.mp4');
It works fine, however when I open another tab and go to my website it just loads until the video has been converted even though that is being done on another tab.
When I open a different browser the website loads just fine.
Note: This also happens without the following code:
$format->on('progress', function ($video, $format, $percentage){
$_SESSION['progress'] = $percentage;
});
But when I transfer the session to the other browser the website also stops functioning.
Question
What is causing this and how can I fix this?