FFmpeg 编译
下载地址:
https://github.com/FFmpeg/FFmpeg
目录准备:
建立一个目录名为FFmpeg,其中建立两个目录,一个名为build(存放编译相关信息),一个名为FFmpeg-master(源代码)。在build路径中建立一个名为@executable_path的目录,用于存放编译结果。
编译:
1 进入编译路径
cd */FFmpeg/build
2 查看编译参数
../FFmpeg-master/configure -h
--disable-securetransport disable Secure Transport, needed for TLS support on OSX if openssl and gnutls are not used
Found private symbol usage.
Symbol: _SecIdentityCreate
From framework: /System/Library/Frameworks/Security.framework/Versions/A/Security
In binary: Contents/MacOS/lib/libavformat.58.dylib
3 编译命令
../FFmpeg-master/configure --prefix=@executable_path --libdir=@executable_path --arch=x86 --enable-shared --disable-static --disable-doc --enable-gpl --enable-version3 --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libx265 --enable-zlib --enable-libvorbis --enable-libopus --disable-securetransport
../FFmpeg-master/configure --prefix=@executable_path --libdir=@executable_path --arch=x86 --enable-shared --disable-static --disable-doc --enable-gpl --enable-version3 --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libx265 --enable-zlib --enable-libvorbis --enable-libopus --disable-securetransport
ERROR: opus not found using pkg-config
ERROR: vorbis not found using pkg-config
export PKG_CONFIG_PATH=/usr/local/pkgconfig:/usr/local/lib/pkgconfig:/usr/share/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig
如果:没有libx264等库,使用brew install 安装。
4 编译并安装
make
make install
5 更改各个库的默认搜索路径
libavformat.dylib
install_name_tool -change @executable_path/libavcodec.58.dylib @executable_path/lib/libavcodec.58.dylib "/Volumes/860_500/学习/FFmpeg/build/@executable_path/libavformat.58.dylib"
install_name_tool -change @executable_path/libavcodec.58.dylib @executable_path/lib/libavcodec.58.dylib "/Volumes/860_500/学习/FFmpeg/build/@executable_path/libavformat.58.dylib"
。。。。。。