1、源码地址下载
下载地址
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
2、进入下载目录
cd ffmpeg目录
3、configure配置
./configure --prefix=/usr/local/ffmpeg --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-filter=delogo --enable-debug --disable-optimizations --enable-libspeex --enable-videotoolbox --enable-shared --enable-pthreads --enable-version3 --enable-ffplay --enable-hardcoded-tables --cc=clang --host-cflags= --host-ldflags= --disable-x86asm
4、编译
执行make命令进行编译。
make
5、进行ffmpeg的安装
make install
6、编译过程中错误
6.1、ERROR: libfdk_aac not found
6.1.1、库未安装
源码方式编译安装
git clone git://github.com/mstorsjo/fdk-aac
autoreconf -i
./configure
make&&make install
brew 安装
brew install fdk-aac
6.1.2、库已安装
如果
6.2、ERROR: speex not found using pkg-config
查看日志 ffbuild/config.log
pkg-config --exists --print-errors speex
Package speex was not found in the pkg-config search path.
Perhaps you should add the directory containing `speex.pc'
to the PKG_CONFIG_PATH environment variable
No package 'speex' found
ERROR: speex not found using pkg-config
安装speex
brew install speex
6.3、ERROR: libx264 not found
源码安装
git clone https://code.videolan.org/videolan/x264.git
./configure --enable-static --enable-shared --disable-asm --disable-avs
make&&make install
brew 安装
brew install x264
6.4、ERROR: x265 not found using pkg-config
brew 安装
brew install x265
6.5、编译ffplay需要sdl2的支持
brew install sdl2
网友评论