If you're using ffmpeg
executable you won't need ffmpeg-php
. You might want to use ffmpeg
executable only, since together with ffprobe
executable you could do anything.
I didn't get the point of your $extension*
's variables. To know the absolute path where your ffmpeg
is installed you could use the which
program: which ffmpeg
.
Your exec()
call checking is wrong, I'd suggest you to use it this way:
exec("ffmpeg -v error -y -ss $timeOffset -i $videoPath -vframes 1 $finalfilename 2>&1 >/dev/null", $stderr, $exit_status);
if ($exit_status === 0) {
print 'Done! :)';
} else {
print 'Error... :/';
// implode("\n", $stderr) will help you figure out what happened...
}
I've added -v error
to let ffmpeg
output only error messages and -y
to avoid $finalfilename
file-existing issue. I've also suppressed all STDOUT
and moved only STDERR
output to $stderr
variable. If your exec()
call fail for some reason ($exit_status
will be non 0), you'll get what happened on that $stderr
array.
If I'm missing something, please, let me know!