MacOSXインストールffmpeg

3618 ワード

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.33 Gの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を利用できるようになりました.