I found this question which is the same question I have, but with the small but important difference, that I'm using Windows so cronjobs are no thing.
I basically want to convert a video in PHP, but don't want the PHP script to hang up until the conversion is finished and instead return immediately.
My current code:
if ($videoext !== "mp4") {
exec ( "./ffmpeg.exe -i " . $inputFile. " " . $outputFile/*without extension*/ . ".mp4" );//convert to useable format
if (! in_array ( $videoext, $GLOBALS ['fileextensions'] )) {//Unsupported extension
unlink ( $inputFile);//delete if not useful
}
}
I'm using PHP7 with XAMPP for windows Any help is appreciated
EDIT: I know that pthreads exist, but I'm not sure if they do what I'd expect them to do and too stupid to get them working on my XAMPP installation