1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

For #1659, #307, add ffmpeg-4.2-fit for rtc

This commit is contained in:
winlin 2020-03-22 16:34:54 +08:00
parent 634a14bfa6
commit 4308f238c0
690 changed files with 182077 additions and 1 deletions

View file

@ -400,7 +400,6 @@ fi
# libopus, for WebRTC to transcode AAC with Opus.
#####################################################################################
if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
# cross build not specified, if exists flag, need to rebuild for no-arm platform.
if [[ -f ${SRS_OBJS}/opus/lib/libopus.a ]]; then
echo "The opus-1.3.1 is ok.";
else
@ -417,6 +416,70 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
if [ ! -f ${SRS_OBJS}/opus/lib/libopus.a ]; then echo "Build opus-1.3.1 failed."; exit -1; fi
fi
#####################################################################################
# ffmpeg-fix, for WebRTC to transcode AAC with Opus.
#####################################################################################
if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
if [[ -f ${SRS_OBJS}/ffmpeg/lib/libavcodec.a ]]; then
echo "The ffmpeg-4.2-fit is ok.";
else
echo "Building ffmpeg-4.2-fit.";
(
rm -rf ${SRS_OBJS}/ffmpeg-4.2-fit && cd ${SRS_OBJS} && ABS_OBJS=`pwd` &&
ln -sf ../3rdparty/ffmpeg-4.2-fit && cd ffmpeg-4.2-fit &&
PKG_CONFIG_PATH=$ABS_OBJS/opus/lib/pkgconfig ./configure \
--prefix=`pwd`/_release \
--pkg-config-flags="--static" \
--extra-libs=-lpthread \
--extra-libs=-lm \
--disable-programs \
--disable-doc \
--disable-htmlpages \
--disable-manpages \
--disable-podpages \
--disable-txtpages \
--disable-avdevice \
--disable-avformat \
--disable-swscale \
--disable-postproc \
--disable-avfilter \
--disable-network \
--disable-dct \
--disable-dwt \
--disable-error-resilience \
--disable-lsp \
--disable-lzo \
--disable-faan \
--disable-pixelutils \
--disable-hwaccels \
--disable-devices \
--disable-audiotoolbox \
--disable-videotoolbox \
--disable-appkit \
--disable-coreimage \
--disable-avfoundation \
--disable-securetransport \
--disable-iconv \
--disable-lzma \
--disable-sdl2 \
--disable-everything \
--enable-decoder=aac \
--enable-decoder=aac_fixed \
--enable-decoder=aac_latm \
--enable-decoder=libopus \
--enable-encoder=aac \
--enable-encoder=opus \
--enable-encoder=libopus \
--enable-libopus &&
make ${SRS_JOBS} && make install
cd .. && rm -rf ffmpeg && ln -sf ffmpeg-4.2-fit/_release ffmpeg
)
fi
# check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "Build ffmpeg-4.2-fit failed, ret=$ret"; exit $ret; fi
if [ ! -f ${SRS_OBJS}/ffmpeg/lib/libavcodec.a ]; then echo "Build ffmpeg-4.2-fit failed."; exit -1; fi
fi
#####################################################################################
# live transcoding, ffmpeg-4.1, x264-core157, lame-3.99.5, libaacplus-2.0.2.
#####################################################################################