PHP: shell_exec(); not working identical to cmd? [WIN10 CMD]
Solution:
Seems ffmpeg
filename extension is missing. Please try
$MergeCommand = "C:\\Users\\Admin\\Documents\\ffmpeg-2021-02-20-git-51a9f487ae-full_build\\bin\\ffmpeg.exe -i \"" . $path . $videoname . "\" -i \"" . $path . $audioname . "\" -c:v copy -c:a aac \"" . $path . $filename . "FINAL.mp4\"";
shell_exec($MergeCommand);
echo($MergeCommand);
Answer
Solution:
Alright, I've fixed it myself!
I actually have no clue how that fixed it but it did.
I exchanged the first shell_exec($strCmd);
(The command I
run before $MergeCommand) with:
$output = null;
exec($strCmd, $output);
$output = implode(" ", $output);
and it works perfectly fine now. Seems like the first shell_exec
which executed the command successfully, blocked any other cmd execution
afterwards.