安装库
brew install automake fdk-aac git lame libass libtool libvorbis libvpx \
opus sdl shtool texi2html theora wget x264 x265 xvid nasm
编译安装
cd ffmpeg-3.2.5
./configure
make -j4
make install
完成。
笔记
pkg-config 是一个在源代码编译时查询已安装的库的使用接口的计算机工具软件。
FreeType是一個用C語言實現的一個字体光栅化函式庫。它可以用來將字符柵格化並映射成位图以及提供其他字體相關業務的支持。
报错
make
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [ffprobe_g] Error 1
解:安装库,make clean
。
brew安装库
luojinrong-MacBook-Pro:bin luojinrong$ brew install freetype
Warning: freetype 2.9 is already installed, it's just not linked
You can use `brew link freetype` to link this version.
luojinrong-MacBook-Pro:bin luojinrong$ brew link freetype
Linking /usr/local/Cellar/freetype/2.9...
Error: Could not symlink lib/pkgconfig/freetype2.pc
/usr/local/lib/pkgconfig is not writable.
解:
brew doctor 检查错误,可以不执行这个命令
sudo chown -R $(whoami) /usr/local/lib/pkgconfig
参考: package - Brew error: Could not symlink, path is not writable - Stack Overflow
https://stackoverflow.com/questions/27784545/brew-error-could-not-symlink-path-is-not-writable
参考
CompilationGuide/macOS – FFmpeg
https://trac.ffmpeg.org/wiki/CompilationGuide/macOS