0

I want to convert some GIFs to mp4. I tried to use CloudConvert, but when I installed the packages and configure the curl.cainfo I get that message that says

FatalErrorException in CurlFactory.php line 271:
Maximum execution time of 120 seconds exceeded

This is the code of converting enter image description here

chrki
  • 6,143
  • 6
  • 35
  • 55
  • Because nobody does heavy data processing and waits for answer on request time. Time that user can wait for response normally is 1 second. You should think about queuing convertion process and start Your workers to do it in background and when it's ready to put the flag in database that A.gif converted to A.mp4. So You have to make some loading screen that continuously requests (using ajax) Your app to get informed that it has "done" flag and if it has so put download link to interface. – num8er Jul 08 '16 at 11:29
  • @num8er thanks bro I will try to do it – Quantumass soufiane Jul 08 '16 at 22:26

1 Answers1

0

The video encoding process may need several minutes conversion time. To avoid such CURL timeout issues you should use an asynchronous implementation:

# Script: sendConversion
CloudConvert::file('/a/path/to/file.gif')
            ->callback('http://myserver.com/save_file.php')
            ->convert('mp4');

And in "save_file.php":

# Script: saveFile
CloudConvert::useProcess($_REQUEST['url'])
            ->save('/path/converted.mp4');
monday
  • 287
  • 2
  • 3