Reputation: 1075
I'm running Max OS 10.7, MAMP (PHP 5.3.6), with FFMPEG installed. I want to convert videos from one format to another. The following entered into Terminal works fine:
ffmpeg -i /path/video.wmv /path/video.flv
The file video.wmv is converted to video.flv. Great! Now, this PHP line DOESN'T work:
exec('ffmpeg -i /path/video.wmv /path/video.flv');
Why? I've spent many hours reading up on this and I still can't figure out what is wrong. I have read the other discussions on this topic and there is no clear answer. Any help would be greatly appreciated! (PHP safe_mode is off).
Upvotes: 2
Views: 6928
Reputation: 1684
I would double check that the path to ffmpeg is correct. Also, take a look at the output to see if has anything useful, like this:
exec("/usr/bin/ffmpeg -i $srcFile $destFile 2>&1", $output);
var_dump($output);
Upvotes: 7