Detect FFmpeg installation and Version
Try:
$ffmpeg = trim(shell_exec('which ffmpeg')); // or better yet:$ffmpeg = trim(shell_exec('type -P ffmpeg'));
If it comes back empty ffmpeg is not available, otherwise it will hold the absolute path to the executable, which you may use in the actual ffmpeg call:
if (empty($ffmpeg)){ die('ffmpeg not available');}shell_exec($ffmpeg . ' -i ...');