I'm using Windows Server 2016
This is the PHP code I use:
exec('"' . $ffmpeg . '" -y -i "' . $inputFile . '" -vcodec copy -acodec copy -ss 00:00:00 -to ' . $till . ' "' . $temp . '" 2>&1', $output, $return_var);
It works but after that I get 500 Internal Server Error
which lasts about 2 - 3 seconds.
I tried to change 2>&1
to > /dev/null 2>&1 &
based on this answer so:
exec('"' . $ffmpeg . '" -y -i "' . $inputFile . '" -vcodec copy -acodec copy -ss 00:00:00 -to ' . $till . ' "' . $temp . '" > /dev/null 2>&1 &', $output, $return_var);
but now the conversion doesn't work any more.
EDIT:
I should add that the 500 Internal Server Error doesn't happen when I run the script but when I open the website within 2 - 3 seconds after conversion