 <p>If this is only a timeout error, try putting set_time_limit(xx); on top of your code. With xx corresponding to the time to wait in seconds.</p> <p>Putting 0 means no time limit, but it may be endless if your script enters an infinite loop, of if it is waiting a feedback from your encoding command that never arrives...</p>