1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00

upgrade x264 and ffmpeg to newest version (#1274)

The ffmpeg and x264 in srs is too old.

Signed-off-by: Steven Liu lq@chinaffmpeg.org
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
Steven Liu 2018-11-27 21:17:42 +08:00 committed by winlin
parent 99430d2edb
commit 78cf3d4b58
5 changed files with 17 additions and 17 deletions

Binary file not shown.

View file

@ -68,34 +68,34 @@ else
ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build speex-1.2rc1 failed"; exit 1; fi ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build speex-1.2rc1 failed"; exit 1; fi
fi fi
# x264 core.138 # x264 core.157
if [[ -f ${ff_release_dir}/lib/libx264.a ]]; then if [[ -f ${ff_release_dir}/lib/libx264.a ]]; then
echo "x264 is ok" echo "x264 is ok"
else else
echo "build x264" echo "build x264"
cd $ff_current_dir && cd $ff_current_dir &&
rm -rf x264-snapshot-20131129-2245-stable && unzip -q ${ff_src_dir}/x264-snapshot-20131129-2245-stable.zip && rm -rf x264-snapshot-20181116-2245 && unzip -q ${ff_src_dir}/x264-snapshot-20181116-2245.zip &&
cd x264-snapshot-20131129-2245-stable && cd x264-snapshot-20181116-2245 &&
chmod +w configure && patch -p0 <../../../3rdparty/patches/5.x264.osx.gcc.patch && # chmod +w configure && patch -p0 <../../../3rdparty/patches/5.x264.osx.gcc.patch &&
./configure --prefix=${ff_release_dir} --disable-opencl --bit-depth=8 \ ./configure --prefix=${ff_release_dir} --disable-opencl --bit-depth=all \
--enable-static --disable-avs --disable-swscale --disable-lavf \ --enable-static --disable-avs --disable-swscale --disable-lavf \
--disable-ffms --disable-gpac && --disable-ffms --disable-gpac --disable-cli &&
make ${SRS_JOBS} && make install make ${SRS_JOBS} && make install
ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build x264 failed"; exit 1; fi ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build x264 failed"; exit 1; fi
fi fi
# ffmpeg-2.1.1 # ffmpeg-4.1
if [[ -f ${ff_release_dir}/bin/ffmpeg ]]; then if [[ -f ${ff_release_dir}/bin/ffmpeg ]]; then
echo "ffmpeg-2.1.1 is ok" echo "ffmpeg-4.1 is ok"
else else
echo "build ffmpeg-2.1.1" echo "build ffmpeg-4.1"
cd $ff_current_dir && cd $ff_current_dir &&
rm -rf ffmpeg-2.1.1 && unzip -q ${ff_src_dir}/ffmpeg-2.1.1.zip && rm -rf ffmpeg-4.1 && unzip -q ${ff_src_dir}/ffmpeg-4.1.zip &&
echo "remove all so to force the ffmpeg to build in static" && echo "remove all so to force the ffmpeg to build in static" &&
rm -f ${ff_release_dir}/lib/*.so* && rm -f ${ff_release_dir}/lib/*.so* &&
echo "export the dir to enable the build command canbe use." && echo "export the dir to enable the build command canbe use." &&
export ffmpeg_exported_release_dir=${ff_release_dir} && export ffmpeg_exported_release_dir=${ff_release_dir} &&
cd ffmpeg-2.1.1 && cd ffmpeg-4.1 &&
./configure \ ./configure \
--enable-gpl --enable-nonfree \ --enable-gpl --enable-nonfree \
--yasmexe=${ff_yasm_bin} \ --yasmexe=${ff_yasm_bin} \
@ -103,7 +103,7 @@ else
--enable-static --disable-shared --disable-debug \ --enable-static --disable-shared --disable-debug \
--extra-cflags='-I${ffmpeg_exported_release_dir}/include' \ --extra-cflags='-I${ffmpeg_exported_release_dir}/include' \
--extra-ldflags='-L${ffmpeg_exported_release_dir}/lib -lm -ldl' \ --extra-ldflags='-L${ffmpeg_exported_release_dir}/lib -lm -ldl' \
--disable-ffplay --disable-ffprobe --disable-ffserver --disable-doc \ --disable-ffplay --disable-ffprobe --disable-doc \
--enable-postproc --enable-bzlib --enable-zlib --enable-parsers \ --enable-postproc --enable-bzlib --enable-zlib --enable-parsers \
--enable-libx264 --enable-libmp3lame --enable-libfdk-aac --enable-libspeex \ --enable-libx264 --enable-libmp3lame --enable-libfdk-aac --enable-libspeex \
--enable-pthreads --extra-libs=-lpthread \ --enable-pthreads --extra-libs=-lpthread \

View file

@ -678,13 +678,13 @@ if [ $SRS_SSL = YES ]; then
fi fi
##################################################################################### #####################################################################################
# live transcoding, ffmpeg-2.1, x264-core138, lame-3.99.5, libaacplus-2.0.2. # live transcoding, ffmpeg-4.1, x264-core157, lame-3.99.5, libaacplus-2.0.2.
##################################################################################### #####################################################################################
if [ $SRS_FFMPEG_TOOL = YES ]; then if [ $SRS_FFMPEG_TOOL = YES ]; then
if [[ -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]]; then if [[ -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]]; then
echo "ffmpeg-2.1 is ok."; echo "ffmpeg-4.1 is ok.";
else else
echo "build ffmpeg-2.1"; echo "build ffmpeg-4.1";
( (
cd ${SRS_OBJS} && pwd_dir=`pwd` && cd ${SRS_OBJS} && pwd_dir=`pwd` &&
rm -rf ffmepg.src && mkdir -p ffmpeg.src && cd ffmpeg.src && rm -rf ffmepg.src && mkdir -p ffmpeg.src && cd ffmpeg.src &&
@ -693,8 +693,8 @@ if [ $SRS_FFMPEG_TOOL = YES ]; then
) )
fi fi
# check status # check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "build ffmpeg-2.1 failed, ret=$ret"; exit $ret; fi ret=$?; if [[ $ret -ne 0 ]]; then echo "build ffmpeg-4.1 failed, ret=$ret"; exit $ret; fi
if [ ! -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]; then echo "build ffmpeg-2.1 failed."; exit -1; fi if [ ! -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]; then echo "build ffmpeg-4.1 failed."; exit -1; fi
fi fi
##################################################################################### #####################################################################################