ffmpeg MAMP“dyld:未加载库”错误 [英] ffmpeg MAMP "dyld: Library not loaded" error

查看:449
本文介绍了ffmpeg MAMP“dyld:未加载库”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过PHP的 exec()命令在MAMP中的Mac OSX 10.7.3上使用ffmpeg,我有一个绝对路径设置为调用ffmpeg,例如

  / opt / local / bin / ffmpeg -i/sample.avi

但是我收到以下错误 -

  dyld:库不加载:/opt/local/lib/libjpeg.8.dylib参考自:/opt/local/lib/libopenjpeg.1.dylib原因:不兼容的库版本:libopenjpeg.1.dylib需要版本13.0.0或更高版本,但libJPEG .dylib提供版本12.0.0 

NB 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.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);

解决方案

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_PATH

and restart Apache

这篇关于ffmpeg MAMP“dyld:未加载库”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆