
Mac High Sierra に ffmpeg をインストール
本記事にはアフィリエイト広告が含まれます。
いつからかmacでffmpegが使えなくなっていて一筋縄ではいかなそうだから放置していたけど、ffmpegがあった方が何かと便利なので何とかインストールした。
 ちょっと苦労した。
検索してあれこれやってみてだめだったので Homebrew 自体を一旦アンインストールしてインストールし直したところから… 
 今思えばこれは必要なかったかもしれない。
 SDL と Theora のインストール だけで良かったと思う。
(Mac High Sierra にアップグレードした直後だったし、そもそも Homebrew 自体よくわかってないままだったから最初からやり直してみようということで…。)
目次
Homebrew
Homebrew アンインストール
| 1 | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" | 
(削除して良いか聞かれるので y を入力してEnter)
Homebrew インストール
| 1 | /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | 
Homebrew アップデート
| 1 2 | $ brew update Already up-to-date. | 
brew doctor
| 1 | $ brew doctor | 
なんか色々出てきた。
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | lease 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 or file an issue; just ignore this. Thanks! Warning: Unbrewed header files were found in /usr/local/include. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected header files:   /usr/local/include/node/android-ifaddrs.h   /usr/local/include/node/ares.h ・・・・・・・・・ | 
の下にディレクトリの羅列、これは無視した。
最後に、
| 1 2 3 4 | Warning: Your XQuartz (2.7.9) is outdated. Please install XQuartz 2.7.11 (or delete the current version). XQuartz can be updated using Homebrew-Cask by running   brew cask reinstall xquartz | 
と出てきたので言う通りにxquartzインストール
xquartz リインストール
| 1 | $ brew cask reinstall xquartz | 
再び brew doctor
| 1 | $ brew doctor | 
lease note that these warnings are just used to help the Homebrew maintainers…. というのは出ているままだけど
 xquartz の Warning は無くなったので ffmpeg に進んでみる
ffmpeg
ffmpeg インストール
| 1 | $ brew install ffmpeg | 
SDL と Theora のインストール
ffmpegインストール後、エラー解消のため SDL と Theora をインストールした経緯
ffmpeg バージョン確認
| 1 | $ ffmpeg -version | 
エラー出たー
| 1 2 3 4 | dyld: Library not loaded: /usr/local/lib/libSDL-1.2.0.dylib   Referenced from: /Users/xxxxx/bin/ffmpeg   Reason: image not found Abort trap: 6 | 
sdlが必要らしい
SDL インストール
| 1 | $ brew install sdl | 
もう一回バージョン確認
| 1 | $  ffmpeg -version | 
またエラー
| 1 2 3 4 | dyld: Library not loaded: /usr/local/lib/libtheoraenc.1.dylib   Referenced from: /Users/xxxxx/bin/ffmpeg   Reason: image not found Abort trap: 6 | 
Homebrew を再インストールする前もこのエラーが出ていて、「libtheoraenc.1.dylib」とか「libtheoraenc」で検索しても一向に分からず難航してたけど、やっと発見。
Theora とゆうやつをインストールすれば良いみたい。
Theora インストール
| 1 | $ brew install theora | 
再び バージョン確認
| 1 2 3 4 5 6 7 8 9 10 11 12 | $  ffmpeg -version ffmpeg version git-2014-08-29-be3d807 Copyright (c) 2000-2014 the FFmpeg developers built on Aug 29 2014 20:10:37 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) configuration: --prefix=/Users/xxxxx --libdir=/Users/xxxxx/lib --incdir=/Users/xxxxx/include --enable-libfaac --enable-libx264 --enable-libxvid --enable-nonfree --enable-gpl --enable-libmp3lame --enable-pthreads --enable-libvpx --enable-libvorbis --disable-mmx --enable-shared --enable-libtheora --pkg-config=pkg-config --enable-version3 --enable-pic --extra-cflags=-I/Users/xxxxx/include --extra-ldflags=-L/Users/xxxxx/lib libavutil      54.  7.100 / 54.  7.100 libavcodec     56.  1.100 / 56.  1.100 libavformat    56.  3.100 / 56.  3.100 libavdevice    56.  0.100 / 56.  0.100 libavfilter     5.  0.103 /  5.  0.103 libswscale      3.  0.100 /  3.  0.100 libswresample   1.  1.100 /  1.  1.100 libpostproc    53.  0.100 / 53.  0.100 | 
出来たっぽい?
試してみる。
ffmpeg 使ってみる
wavをモノラル変換
| 1 |  ffmpeg -i test.wav -y -ac 1 test-mono.wav | 
出来たー!???? (一瞬で終わる!)
↑nanaに伴奏をアップしたかったのでwavをモノラル変換
 (iTunesでも出来るけどいちいち設定を変更するのが面倒。)
 お母ちゃん 
             2018.5.2
            お母ちゃん 
             2018.5.2 
          
 
		 
		 
		 
		 
		 
		