-
Notifications
You must be signed in to change notification settings - Fork 0
v2_EN_Build
You can directly use the release binaries, or build SRS step by step. See: Github: release or Mirror of China: release
- Centos6.x/Ubuntu12 is proved for Usage of README.
- Recomment to use Centos6.x/Ubuntu12 for demo of SRS, because it's complex to compile FFMPEG.
- Turn some features off when you need to compile SRS on other OS.
Sometimes the stream play failed, but without any error message, or server cann't connect to. Please check the iptables and selinux.
Turn off iptables:
# disable the firewall
sudo /etc/init.d/iptables stop
sudo /sbin/chkconfig iptables off
Disable the selinux, to run getenforce
to ensure the result is Disabled
:
- Edit the config of selinux:
sudo vi /etc/sysconfig/selinux
- Change the SELINUX to disabled:
SELINUX=disabled
- Rebot:
sudo init 6
It's very easy to build SRS:
./configure && make
Also easy to start SRS:
./objs/srs -c conf/srs.conf
Publish RTMP, please see: Usage: RTMP
More usages, please see: Usage
Each big feature is controlled by a build option, while a preset provides a set of options.
SRS will apply preset first, then apply user specified options, for example, ./configure --rtmp-hls --with-http-api
will:
- apply preset: --rtmp-hls, enable rtmp ssl and hls, disable others.
- apply user specified options: --with-http-api, enable http api.
So, the built SRS will support RTMP+HLS+HttpApi.
All preset and options supported is specified by command ./configure -h
.
It will take long time to compile SRS when ffmpeg/nginx enabled. You can use multiple cpu to speedup, similar to the make --jobs=N
.
- configure --jobs=N: to speedup when compile ffmpeg/nginx.
- make --jobs=N: to speedup when compile SRS.
The following components can be speedup, SRS will auto apply the --jobs automatically:
- SRS: support.
- st-1.9: not support, for it's small.
- http-parser: not support, for it's small.
- openssl: not support.
- nginx: support.
- ffmpeg: support.
- lame: support.
- libaacplus: not support.
- x264: support.
The usage to speedup configure:
./configure --jobs=16
Note: configure donot support -jN
, only support --jobs=N
.
The usage to speedup make SRS:
// or make --jobs=16
make -j16
SRS provides package script, to package the install zip on release website.
The package script will build SRS, then zip the files. See help of package script:
[winlin@dev6 srs]$ ./scripts/package.sh --help
--help print this message
--x86-x64 configure with x86-x64 and make srs.
--arm configure with arm and make srs.
SRS depends on g++/gcc/make, st-1.9, http-parser2.1, ffmpeg, cherrypy, nginx, openssl-devel and python2。
The g++/gcc/make and st-1.9 is required, others are optional.
User can use other compile tool chain, for instance, arm usig arm-linux-g++, see: ARM:compile manually
The outputs of configure and make are put in objs.
- ./objs/srs The SRS application.
- ./objs/research/librtmp/srs_bandwidth_check linux bandwidth test tool.
- ./objs/research/librtmp/srs_ingest_flv ingest FLV file to RTMP stream to SRS.
- ./objs/research/librtmp/srs_ingest_rtmp ingest RTMP to RTMP to SRS.
- ./objs/nginx/sbin/nginx delivery HLS.
- research/api-server/server.py the api-server for demo of SRS.
- ./objs/ffmpeg/bin/ffmpeg the FFMEPG tool to transcode for SRS.
- ./objs/lib/srs_librtmp.a the client librtmp of SRS, see: srs-librtmp
- ./objs/nginx/html/players the players of demo of SRS.
The options of configure:
- --help print help and exit.
- --with-ssl support RTMP complex handshake, see: RTMP Handshake。
- --with-hls support output HLS for mobile(IOS/Android), and PC can use HLS now. See: HLS
- --with-hds support output HDS for Adobe OSMF. See: HDS
- --with-dvr dvr RTMP to FLV file, see: DVR
- --with-nginx build nginx to delivery HLS files and demo pages of SRS.
- --with-http-callback support http callback, for authentication, statistic and event handler, see: HTTP callback
- --with-http-api support http api, see: HTTP API
- --with-http-server enable embeded http server to delivery HTTP files and stream, see: HTTP Server
- --with-stream-caster enable the stream caster, read Stream Caster
- --with-ffmpeg build FFMPEG for transcode, remux and ingest, see: FFMPEG
- --with-transcode live stream transcode, see: FFMPEG
- --with-ingest ingest file, stream or device to RTMP to SRS, see: Ingest
- --with-stat stat the cpu, memory, network and disk io, user can access stat by http api(not supported by darwin/OSX).
- --with-research buidl the research tools, for instance, ts info, ingest flv/rtmp, flv parser and bandwidth test.
- --with-utest build the utest of SRS, it's ok to disable it.
- --with-gperf use google tcmalloc, seems no effect.
- --with-gmc use gerf memory check, which will hurt performance, only for memory check, see: gperf
- --with-gmp use gperf memory performance analysis, which will hurt performance, only for memory performance analysis, see: gperf
- --with-gcp use gperf cpu profile, which will hurt performance, only for cpu profile, see: gperf
- --with-gprof use gprof, which will hurt performance, see: gprof
- --with-librtmp client librtmp, see: srs-librtmp
- --with-arm-ubuntu12 cross build SRS for arm on ubuntu12, see: srs-arm
- --jobs[=N] the parallelly process to build, sames to the -j/--jobs of make, see: Build: jobs
- --static use static link for arm, see: ARM
The preset of configure:
- --x86-x64, default, for x86(32bits) or x64(64bits) server.
- --osx,for the MAC OSX(Darwin) of apple, depends on xcode and brew.
- --pi,for raspberry-pi, an arm machine.
- --cubie,for cubieboard, similar to ubuntu.
- --arm,for arm, cross build on ubuntu12. Alias is --with-arm-ubuntu12.
- --mips,for mips, cross build on ubuntu12, for hiwifi(experiment for memory leak).
- --dev,for dev to enable the most features.
- --fast,for fast build, disable almost all features, only enable basic RTMP without complex handshake(ssl).
- --pure-rtmp,only enalbe RTMP, with complex handshake(ssl) to support delivery h.264+aac.
- --rtmp-hls,support RTMP and HLS, typical features.
- --disable-all, disable all, only support RTMP without complex handshake, delivery vp6, depneds on st only.
- --demo,enable the demo of SRS.
- --full,enable all features of SRS.
The expert options, maybe compile failed:
- --use-sys-ssl use the ssl of linux system, which installed by yum or apt-get. This is ok when --with-ssl specified and donot compile the ssl of 3rdparty.
- --export-librtmp-project=<path> export srs-librtmp to specified project in path.
Winlin 2014.11