MacOSX 安装ffmpeg

想将ffmpeg安装到Mac上,结果出现一堆堆的问题,耐住性子,一一解决。

ffmpeg有相关的MacOSX上的编译文档,可以参阅ffmpeg MacOSX Compile

原来想自己手动编译,不用brew来安装ffmpeg,后来在执行brew install ffmpeg的时候都出现来N多问题,于是回头,自己编译,解决问题。


brew我之前安装过,但是每次brew doctor的时候可以会出现以下提示,自己也没有在意,但是现在是需要解决的时候了,因为我安装ffmpeg总是提示各种错误。

按照ffmpeg编译文档编译

brew install automake fdk-aac git lame libass libtool libvorbis libvpx opus sdl shtool texi2html theora wget x264 xvid yasm

configure之后总是说已经安装的lib找不到,例如

ERROR: libass not found

总是不明所以,于是怀疑还是brew的问题,果断brew doctor,然后解决各种问题。

brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: You have an outdated version of /usr/bin/install_name_tool installed.
This will cause binary package installations to fail.
This can happen if you install osx-gcc-installer or RailsInstaller.
To restore it, you must reinstall OS X or restore the binary from
the OS packages.

Warning: You seem to have osx-gcc-installer installed.
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
is an unlicensed distribution of really old Xcode files.
Please run `xcode-select --install` to install the CLT.


Google之,找到相关的文章, 链接


通过命令查看本地的install_name_tool的信息

otool -L /usr/bin/install_name_tool
/usr/bin/install_name_tool:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.0.0)

解决办法就是下载MacOSX 系统,重新安装Essentials.pkg,我下载了5.33G的10.9.5版本的Mavericks

通过命令行来打开安装包,

open /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg

如果已经加载,无需上面命令,继续执行

open /Volumes/OS\ X\ Install\ ESD/Packages/Essentials.pkg


安装的时候需要耐心等待,大概需要30分钟左右,安装完成之后继续执行otool命令

otool -L /usr/bin/install_name_tool 
/usr/bin/install_name_tool:
	/usr/lib/libxcselect.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)


并且执行brew doctor 命令

brew doctor
Your system is ready to brew.


现在开始编译ffmpeg,配置如下:

./configure  --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --cc=/usr/bin/clang

但是make的时候又出现问题:

libavformat/os_support.c:66:12: error: implicit declaration of function 'inet_aton' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
    return inet_aton(str, add);


没有找到相关的解决办法,可以搜索到ffmpeg自动化编译的页面,但是没有解决方法, ffmpeg fate

但是在这个页面发现不同的Rev,所以就尝试更新了代码,我下载的代码已经是比较新的代码了,版本号

./version.sh 
N-66387-g9c843fb

通过git pull 下载最新的代码,版本

./version.sh 
N-66417-g3bc0361


然后make通过

剩下的就是安装了sudo make install


可以在Mac下利用强大的ffmpeg了。



  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值