I have a PHP script that use the ffmpeg to compress mov file and convert in mp4.
When I upload a 1gb file, this is converted and in the end appears in console 504 (Gateway Timeout). The instruction I use is this:
$cmd = shell_exec("$ffmpegPath -i $UploadedFilePath -vcodec libx264 -preset ultrafast -filter:v scale=426:-2 $convertUrl 2>&1");
How can I do? I would like the videos to be reduced considerably while maintaining good quality and without overloading the server. The PHP parameters can be found at this link: https://artruism.me/test.php
UPDATE
The call to the script is with ajaxForm