I am using ffmpeg on Mac OSX 10.7.3 in MAMP through PHP's exec()
command, I have an absolute path set to call ffmpeg, e.g.
/opt/local/bin/ffmpeg -i "/sample.avi"
But I receive the following error -
dyld: Library not loaded: /opt/local/lib/libjpeg.8.dylib Referenced from: /opt/local/lib/libopenjpeg.1.dylib Reason: Incompatible library version: libopenjpeg.1.dylib requires version 13.0.0 or later, but libJPEG.dylib provides version 12.0.0
N.B. ffmpeg was installed through Macports.
It works from the command line.
What to do?
EDIT
I've reopened this - originally thought shell_exec()
solved the issue, but infact it should be called differently - and I didn't realise until investigating further today. Here is my code using shell_exec and still giving the error above:
$cmd = '/opt/local/bin/ffmpeg -h';
$cmd = escapeshellcmd($cmd) . ' 2>&1';
$output = shell_exec($cmd);
var_dump($output);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…