diff --git a/README.md b/README.md index 36d59f8d3..650e0c870 100755 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ step 1: build srs
 tar xf simple-rtmp-server-*.*.tar.gz
 cd simple-rtmp-server-*.*/trunk
-./configure --with-ssl --with-hls
+./configure --with-ssl --with-hls --with-ffmpeg
 make
 
step 2: start srs
@@ -117,6 +117,7 @@ usr sys idl wai hiq siq| read writ| recv send| in out | int csw * nginx v1.5.0: 139524 lines
### History +* v0.7, 2013-11-29, support --with/without -ffmpeg. * v0.7, 2013-11-29, add ffmpeg-2.1, x264-core138, lame-3.99.5, libaacplus-2.0.2. * v0.6, 2013-11-29, v0.6 released. 16094 lines. * v0.6, 2013-11-29, add performance summary, 1800 clients, 900Mbps, CPU 90.2%, 41MB. diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh old mode 100644 new mode 100755 index 36c625d82..d6e3b7607 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -47,20 +47,21 @@ if [[ ! -f ${SRS_OBJS}/http-parser-2.1/libhttp_parser.a ]]; then echo "build htt # nginx for HLS, nginx-1.5.0 ##################################################################################### if [ $SRS_HLS = YES ]; then - if [[ -f ${SRS_OBJS}/nginx-1.5.7/_release/sbin/nginx ]]; then + if [[ -f ${SRS_OBJS}/nginx/sbin/nginx ]]; then echo "nginx-1.5.7 is ok."; else echo "build nginx-1.5.7"; ( + pwd_dir=`pwd` && rm -rf ${SRS_OBJS}/nginx-1.5.7 && cd ${SRS_OBJS} && unzip -q ../3rdparty/nginx-1.5.7.zip && cd nginx-1.5.7 && ./configure --prefix=`pwd`/_release && make && make install && - ln -sf `pwd`/_release ../nginx + ln -sf ${pwd_dir}/nginx-1.5.7/_release nginx ) fi # check status ret=$?; if [[ $ret -ne 0 ]]; then echo "build nginx-1.5.7 failed, ret=$ret"; exit $ret; fi - if [ ! -f ${SRS_OBJS}/nginx-1.5.7/_release/sbin/nginx ]; then echo "build nginx-1.5.7 failed."; exit -1; fi + if [ ! -f ${SRS_OBJS}/nginx/sbin/nginx ]; then echo "build nginx-1.5.7 failed."; exit -1; fi # use current user to config nginx, # srs will write ts/m3u8 file use current user, @@ -83,3 +84,30 @@ if [ $SRS_SSL = YES ]; then else echo "#undef SRS_SSL" >> $SRS_AUTO_HEADERS_H fi + +##################################################################################### +# live transcoding, ffmpeg-2.1, x264-core138, lame-3.99.5, libaacplus-2.0.2. +##################################################################################### +if [ $SRS_FFMPEG = YES ]; then + if [[ -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]]; then + echo "ffmpeg-2.1 is ok."; + else + echo "build ffmpeg-2.1"; + ( + pwd_dir=`pwd` && exit 0; + rm -rf ${SRS_OBJS}/nginx-1.5.7 && cd ${SRS_OBJS} && + unzip -q ../3rdparty/nginx-1.5.7.zip && cd nginx-1.5.7 && + ./configure --prefix=`pwd`/_release && make && make install && + ln -sf ${pwd_dir}/nginx-1.5.7/_release nginx + ) + fi + # check status + ret=$?; if [[ $ret -ne 0 ]]; then echo "build ffmpeg-2.1 failed, ret=$ret"; exit $ret; fi + if [ ! -f ${SRS_OBJS}/ffmpeg/bin/ffmpeg ]; then echo "build ffmpeg-2.1 failed."; exit -1; fi +fi + +if [ $SRS_FFMPEG = YES ]; then + echo "#define SRS_FFMPEG" >> $SRS_AUTO_HEADERS_H +else + echo "#undef SRS_FFMPEG" >> $SRS_AUTO_HEADERS_H +fi diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index eaf8fdbfa..f2d05d269 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -4,10 +4,12 @@ help=no SRS_HLS=RESERVED SRS_SSL=RESERVED +SRS_FFMPEG=RESERVED # TODO: remove the default to yes. SRS_HLS=YES SRS_SSL=YES +SRS_FFMPEG=YES opt= @@ -25,9 +27,11 @@ do --with-ssl) SRS_SSL=YES ;; --with-hls) SRS_HLS=YES ;; + --with-ffmpeg) SRS_FFMPEG=YES ;; --without-ssl) SRS_SSL=NO ;; --without-hls) SRS_HLS=NO ;; + --without-ffmpeg) SRS_FFMPEG=NO ;; *) echo "$0: error: invalid option \"$option\"" @@ -65,6 +69,10 @@ if [ $SRS_HLS = RESERVED ]; then echo "you must specifies the hls, see: ./configure --help"; __check_ok=NO fi +if [ $SRS_FFMPEG = RESERVED ]; then + echo "you must specifies the ffmpeg, see: ./configure --help"; + __check_ok=NO +fi if [ $__check_ok = NO ]; then exit 1; fi \ No newline at end of file