但是我收到以下错误 -
dyld:库不加载:/opt/local/lib/libjpeg.8.dylib参考自:/opt/local/lib/libopenjpeg.1.dylib原因:不兼容的库版本:libopenjpeg.1.dylib需要版本13.0.0或更高版本,但libJPEG .dylib提供版本12.0.0NB ffmpeg是通过Macports安装的。
它可以从命令行工作。
该怎么办? >
编辑
我已经重新打开了 - 原来以为 shell_exec ()解决了这个问题,但实际上应该有所不同 - 直到今天进一步调查才明白。这是我的代码使用shell_exec并仍然给出上面的错误:
$ cmd ='/ opt / local / bin / ffmpeg - H'; $ cmd = escapeshellcmd($ cmd)。 '2>& 1'; $ output = shell_exec($ cmd); var_dump($ output);解决方案
问题是DYLD_LIBRARY_PATH设置为MAMP,我已经通过macports安装了ffmpeg。
这可能不是最好的修复,但现在我已经开始运行:
在 / Applications / MAMP / Library / bin / envvars 文件中,并注释如下行:
$ b $ $ b $ / code code code code pre>并重新启动Apache
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.0N.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);解决方案
The problem is that the DYLD_LIBRARY_PATH is set in MAMP and I've installed ffmpeg via macports.
This might not be the best fix but it has me up and running for now:
In the /Applications/MAMP/Library/bin/envvars file and comment the following lines as below:
#DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH" #export DYLD_LIBRARY_PATHand restart Apache
更多推荐
ffmpeg MAMP“dyld:未加载库”错误
发布评论