1. 编译srt
1.1 下载及编译srt代码
git clone https://github.com/Haivision/srt.git
cd srt
./configure
make && make install //或者使用clion的cmake
2. 安装ffmepg之间的准备
2.1 检查是否安装openssl
cmd$ pkg-config --list-all|grep openssl
openssl OpenSSL - Secure Sockets Layer and cryptography libraries and tools
如果已经成功安装,则略过,否则执行
brew install openssl
brew link openssl --force //必须要执行
可能需要执行:
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig"
2.2 检查srt是否安装成功
cmd$: pkg-config --list-all|grep srt
srt srt - SRT library set
3. 安装FFmpeg
3.1 下载ffmpeg代码
3.2 执行./configure:
./configure --enable-libsrt ...
我的例子:
./configure --enable-libsrt --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-11.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-11.0.2.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr --disable-x86asm
如果报错“ERROR: srt >= 1.3.0 not found using pkg-config”
则直接查看 ffbuild/config.log,可能并不是srt的原因,而是其他srt依赖库的问题
3.3 make
3.4 make install
来源:https://blog.csdn.net/liwf616/article/details/99215608