#Simple-RTMP-Server
下载发布版(github):
Centos6-x86_64
其他more...
下载发布版(国内阿里云镜像):
Centos6-x86_64
其他more...
加入QQ群: http://url.cn/WAHICw (Group: 212189142)
获得源码(github): https://github.com/winlinvip/simple-rtmp-server
git clone https://github.com/winlinvip/simple-rtmp-server.git
获得源码(国内CSDN镜像): https://code.csdn.net/winlinvip/srs-csdn
git clone https://code.csdn.net/winlinvip/srs-csdn.git
报告问题(BugReport): https://github.com/winlinvip/simple-rtmp-server/issues/new
中文资料(Wiki): https://github.com/winlinvip/simple-rtmp-server/wiki
使用步骤(Usage): https://github.com/winlinvip/simple-rtmp-server#usage
公用机器(LiveShow): https://github.com/winlinvip/simple-rtmp-server/wiki/LiveShow
捐款(Donation): GitHub
或 阿里云镜像 ,查看
捐献墙(Donations)
| 分支 | 说明 | 维护者 | 主作者 | 状态 |
|---|---|---|---|---|
| SRS-Linux | SRS服务器 Linux平台分支 |
winlin |
winlin wenjie.zhao |
测试中 |
| SRS-Windows | SRS服务器 Windows平台分支 |
suhetao (核桃) |
suhetao | 开发中 |
| SRS-LIBRTMP-Windows | SRS-LIBRTMP客户端库 Windows平台分支 |
chad.wang (videoWorker) |
chad.wang | 停滞 |
对于没有Release的分支:
- 长期处于停滞状态的分支,以及开发缓慢的分支,更换主作者。
- 任何人都可以维护这个分支,代替之前的主作者。
- 分支Release之后,分支的主作者加入SRS主作者。
SRS(SIMPLE RTMP Server) over state-threads created in 2013.10.
SRS is a simple, RTMP/HLS, high-performance, single/multiple(plan) processes, edge/origin live server, x86/x64/arm, compile depends on st(required), ssl and http-parser, use nginx, ffmpeg and cherrypy as external tools. that is, only need st to run srs for minimum run. see Build.
SRS supports vhost, rtmp(encoder push, client/edge pull), ingester(srs pull), HLS, HLS audio only, transcoding, forward, http hooks, http api, http server, dvr, FlashP2P.
注意:FlashP2P系统为chnvideo.com商业方案,SRS只是支持对接。
Release: http://winlinvip.github.io/srs.release
Blog: http://blog.csdn.net/win_lin
CSDN mirror: https://code.csdn.net/winlinvip/srs-csdn
See also: https://github.com/winlinvip/simple-rtmp-server
Github DEMO: demo with your SRS
Wiki: https://github.com/winlinvip/simple-rtmp-server/wiki
TencentQQ: http://url.cn/WAHICw (Group: 212189142)
The PRIMARY AUTHORS are (and/or have been)(Authors ordered by first contribution):
- winlin(winterserver): http://blog.csdn.net/win_lin
- wenjie(wenjiegit): http://blog.chinaunix.net/uid/25006789.html
About the primary AUTHORS:
- Contribute important features to SRS.
- Names of all PRIMARY AUTHORS response in NetConnection.connect and metadata.
- Names of all CONTRIBUTORS response in api/v1/authors.
And here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS -- people who have submitted patches, reported bugs, added translations, helped answer newbie questions, and generally made SRS that much better: AUTHORS.txt
A big THANK YOU goes to:
- chnvideo co-founders(wiseyoung, trueice, leijian) for big supports.
- Genes amd Mabbott for creating st(state-threads).
- Michael Talyanksy for introducing us to use st.
- Roman Arutyunyan for creating nginx-rtmp for SRS to refer to.
- Joyent for creating http-parser for http-api for SRS.
- Igor Sysoev for creating nginx for SRS to refer to.
- FFMPEG and libx264 group for SRS to use to transcode.
- Guido van Rossum for creating Python for api-server for SRS.
Step 1: get SRS
git clone https://github.com/winlinvip/simple-rtmp-server && cd simple-rtmp-server/trunk
Step 2: build SRS, Requires Centos6.x/Ubuntu12 32/64bits, others see Build
./configure && make
Step 3: start SRS
./objs/srs -c conf/srs.conf
See also:
- Usage: How to delivery RTMP?
- Usage: How to delivery HLS?
- Usage: How to delivery HLS for other codec?
- Usage: How to transode RTMP stream by SRS?
- Usage: How to forward stream to other server?
- Usage: How to deploy low lantency application?
- Usage: How to deploy SRS on ARM?
- Usage: How to ingest file/stream/device to SRS?
- Usage: How to use SRS-HTTP-server to delivery HTTP/HLS stream?
- Usage: How to show the demo of SRS?
- Usage: Solution using SRS?
- Usage: Why SRS?
Please select your language:
http://winlinvip.github.io/srs.release/donation/index.html OR aliyun mirror
Donations:
https://github.com/winlinvip/simple-rtmp-server/blob/master/DONATIONS.txt
Supported operating systems and hardware:
- All Linux , both 32 and 64 bits
- All hardware.
- Simple: also stable enough.
- High-performance: single-thread, async socket, event/st-thread driven.
- Support RTMP edge server, support origin server.
- RTMP without vod streaming, live streaming only.
- Support multiple processes, support single process.
- Support vhost, support __defaultVhost__.
- Support adobe rtmp live streaming.
- Support apple HLS(m3u8) live streaming.
- Support HLS audio-only live streaming.
- Support reload config to enable changes.
- Support cache last gop for flash player to fast startup.
- Support listen at multiple ports.
- Support long time(>4.6hours) publish/play.
- High performace, 1800 connections(500kbps), 900Mbps, CPU 90.2%, 41MB
- Support forward publish stream to build active-standby cluster.
- Support broadcast by forward the stream to other servers(origin/edge).
- Support live stream transcoding by ffmpeg.
- Support live stream forward(acopy/vcopy) by ffmpeg.
- Support ffmpeg filters(logo/overlay/crop), x264 params, copy/vn/an.
- Support audio transcode only, speex/mp3 to aac
- Support http callback api hooks(for authentication and injection).
- Support bandwidth test api and flash client.
- Player, publisher(encoder), and demo pages(jquery+bootstrap).
- Demo video meeting or chat(SRS+cherrypy+jquery+bootstrap).
- Full documents in wiki, in chineses.
- Support RTMP(play-publish) library: srs-librtmp
- Support ARM(debian armhf, v7cpu) with rtmp/ssl/hls/librtmp.
- Support init.d and packge script, log to file.
- Support RTMP ATC for HLS/HDS to support backup(failover)
- Support http RESTful management api.
- Support embeded http server for hls(live/vod)
- Support stream ingester using ffmpeg.
- Support ingest RTSP(RTP, SDP) stream to RTMP.
- Support dvr(record live to flv file for vod)
- Support live flashP2P(integrated by chnvideo VDN).
- Support RTMP edge server, push/pull stream from any RTMP server
- Support tracable log, session based log.
- Support vod stream(http flv/hls vod stream).
- Support DRM token traverse for fms origin authenticate.
- [dev] Support system full utest on gtest.
- [plan] Support RTMP 302 redirect #92.
- [plan] Support multiple processes, for both origin and edge
- [no-plan] Support adobe RTMFP(flash p2p) protocol.
- [no-plan] Support adobe flash refer/token/swf verification.
- [no-plan] Support adobe amf3 codec.
- [no-plan] Support encryption: RTMPE/RTMPS, HLS DRM
- [no-plan] Support RTMPT, http to tranverse firewalls
- [no-plan] Support file source, transcoding file to live stream
- [no-plan] Support RTP/RTSP server.
- 2014年05月28日, Release v1.0-mainline4, support heartbeat, tracable log, fix mem leak and bugs. 39200 lines.
- 2014年05月18日, Release v1.0-mainline3, support mips, fms origin, json(http-api). 37594 lines.
- 2014年04月28日, Release v1.0-mainline2, support dvr, android, edge. 35255 lines.
- 2014年04月07日, Release v1.0-mainline, support arm, init.d, http server/api, ingest. 30000 lines.
- 2013年12月25日, Release v0.9, support bandwidth test, player/encoder/chat demos. 20926 lines.
- 2013年12月08日, Release v0.8, support http hooks callback, update st_load. 19186 lines.
- 2013年12月03日, Release v0.7, support live stream transcoding. 17605 lines.
- 2013年11月29日, Release v0.6, support forward stream to origin/edge. 16094 lines.
- 2013年11月26日, Release v0.5, support HLS(m3u8), fragment and window. 14449 lines.
- 2013年11月10日, Release v0.4, support reload config, pause, longtime publish/play. 12500 lines.
- 2013年11月04日, Release v0.3, support vhost, refer, gop cache, listen multiple ports. 11773 lines.
- 2013年10月25日, Release v0.2, support rtmp flash publish, h264, time jitter correct. 10125 lines.
- 2013年10月23日, Release v0.1, support rtmp FMLE/FFMPEG publish, vp6. 8287 lines.
- 2013年10月17日, Created.
- v1.0, 2014年06月23日, support report summaries in heartbeat. 0.9.132
- v1.0, 2014年06月22日, performance refine, support 3k+ connections(270kbps). 0.9.130
- v1.0, 2014年06月21日, support edge token traverse, fix #104. 0.9.129
- v1.0, 2014年06月19日, add connections count to api summaries. 0.9.127
- v1.0, 2014年06月19日, add srs bytes and kbps to api summaries. 0.9.126
- v1.0, 2014年06月18日, add network bytes to api summaries. 0.9.125
- v1.0, 2014年06月14日, fix #98, workaround for librtmp ping(fmt=1,cid=2 fresh stream). 0.9.124
- v1.0, 2014年05月29日, support flv inject and flv http streaming with start=bytes. 0.9.122
- v1.0, 2014年05月28日, 1.0 mainline4(0.9.120) released. 39200 lines.
- v1.0, 2014年05月27日, fix #87, add source id for full trackable log. 0.9.120
- v1.0, 2014年05月27日, fix #84, unpublish when edge disconnect. 0.9.119
- v1.0, 2014年05月27日, fix #89, config to /dev/null to disable ffmpeg log. 0.9.117
- v1.0, 2014年05月25日, fix #76, allow edge vhost to add or remove. 0.9.114
- v1.0, 2014年05月24日, Johnny contribute ossrs.net. karthikeyan start to translate wiki to English.
- v1.0, 2014年05月22日, fix #78, st joinable thread must be stop by other threads, 0.9.113
- v1.0, 2014年05月22日, support amf0 StrictArray(0x0a). 0.9.111.
- v1.0, 2014年05月22日, support flv parser, add amf0 to librtmp. 0.9.110
- v1.0, 2014年05月22日, fix #74, add tcUrl for http callback on_connect, 0.9.109
- v1.0, 2014年05月19日, support http heartbeat, 0.9.107
- v1.0, 2014年05月18日, 1.0 mainline3(0.9.105) released. 37594 lines.
- v1.0, 2014年05月18日, support http api json, to PUT/POST. 0.9.105
- v1.0, 2014年05月17日, fix #72, also need stream_id for send_and_free_message. 0.9.101
- v1.0, 2014年05月17日, rename struct to class. 0.9.100
- v1.0, 2014年05月14日, fix #67 pithy print, stage must has a age. 0.9.98
- v1.0, 2014年05月13日, fix mem leak for delete[] SharedPtrMessage array. 0.9.95
- v1.0, 2014年05月12日, refine the kbps calc module. 0.9.93
- v1.0, 2014年05月12日, fix bug #64: install_dir=DESTDIR+PREFIX
- v1.0, 2014年05月08日, fix #36: never directly use *(int32_t*) for arm.
- v1.0, 2014年05月08日, fix #60: support aggregate message
- v1.0, 2014年05月08日, fix #59, edge support FMS origin server. 0.9.92
- v1.0, 2014年05月06日, fix #50, ubuntu14 build error.
- v1.0, 2014年05月04日, support mips linux.
- v1.0, 2014年04月30日, fix bug #34: convert signal to io thread. 0.9.85
- v1.0, 2014年04月29日, refine RTMP protocol completed, to 0.9.81
- v1.0, 2014年04月28日, 1.0 mainline2(0.9.79) released. 35255 lines.
- v1.0, 2014年04月28日, support full edge RTMP server. 0.9.79
- v1.0, 2014年04月27日, support basic edge(play/publish) RTMP server. 0.9.78
- v1.0, 2014年04月25日, add donation page. 0.9.76
- v1.0, 2014年04月24日, support live flashP2P(integrated by chnvideo VDN). 0.9.75
- v1.0, 2014年04月21日, support android app to start srs for internal edge. 0.9.72
- v1.0, 2014年04月19日, support tool over srs-librtmp to ingest flv/rtmp. 0.9.71
- v1.0, 2014年04月17日, support dvr(record live to flv file for vod). 0.9.69
- v1.0, 2014年04月11日, add speex1.2 to transcode flash encoder stream. 0.9.58
- v1.0, 2014年04月10日, support reload ingesters(add/remov/update). 0.9.57
- v1.0, 2014年04月07日, 1.0 mainline(0.9.55) released. 30000 lines.
- v1.0, 2014年04月07日, support ingest file/stream/device.
- v1.0, 2014年04月05日, support http api and http server.
- v1.0, 2014年04月03日, implements http framework and api/v1/version.
- v1.0, 2014年03月30日, fix bug for st detecting epoll failed, force st to use epoll.
- v1.0, 2014年03月29日, add wiki Performance for RaspberryPi.
- v1.0, 2014年03月29日, add release binary package for raspberry-pi.
- v1.0, 2014年03月26日, support RTMP ATC for HLS/HDS to support backup(failover).
- v1.0, 2014年03月23日, support daemon, default start in daemon.
- v1.0, 2014年03月22日, support make install/install-api and uninstall.
- v1.0, 2014年03月22日, add ./etc/init.d/srs, refine to support make clean then make.
- v1.0, 2014年03月21日, write pid to ./objs/srs.pid.
- v1.0, 2014年03月20日, refine hls code, support pure audio HLS.
- v1.0, 2014年03月19日, add vn/an for FFMPEG to drop video/audio for radio stream.
- v1.0, 2014年03月19日, refine handshake, client support complex handshake, add utest.
- v1.0, 2014年03月16日, fix bug on arm of st, the sp change from 20 to 8, for respberry-pi, @see commit
- v1.0, 2014年03月16日, support ARM(debian armhf, v7cpu) with rtmp/ssl/hls/librtmp.
- v1.0, 2014年03月12日, finish utest for amf0 codec.
- v1.0, 2014年03月06日, add gperftools for mem leak detect, mem/cpu profile.
- v1.0, 2014年03月04日, add gest framework for utest, build success.
- v1.0, 2014年03月02日, add wiki srs-librtmp, SRS for arm, product
- v1.0, 2014年03月02日, srs-librtmp, client publish/play library like librtmp.
- v1.0, 2014年03月01日, modularity, extract core/kernel/rtmp/app/main module.
- v1.0, 2014年02月28日, support arm build(SRS/ST), add ssl to 3rdparty package.
- v1.0, 2014年02月28日, add wiki BuildArm, FFMPEG, Reload
- v1.0, 2014年02月27日, add wiki LowLatency, HTTPCallback, ServerSideScript, IDE
- v1.0, 2014年01月19日, add wiki DeliveryHLS
- v1.0, 2014年01月12日, add wiki HowToAskQuestion, RtmpUrlVhost
- v1.0, 2014年01月11日, fix jw/flower player pause bug, which send closeStream actually.
- v1.0, 2014年01月05日, add wiki Build, Performance, Cluster
- v1.0, 2014年01月01日, change listen(512), chunk-size(60000), to improve performance.
- v1.0, 2013年12月27日, merge from wenjie, the bandwidth test feature.
- v0.9, 2013年12月25日, v0.9 released. 20926 lines.
- v0.9, 2013年12月25日, fix the bitrate bug(in Bps), use enhanced microphone.
- v0.9, 2013年12月22日, demo video meeting or chat(SRS+cherrypy+jquery+bootstrap).
- v0.9, 2013年12月22日, merge from wenjie, support banwidth test.
- v0.9, 2013年12月22日, merge from wenjie: support set chunk size at vhost level
- v0.9, 2013年12月21日, add players for play and publish.
- v0.9, 2013年12月15日, ensure the HLS(ts) is continous when republish stream.
- v0.9, 2013年12月15日, fix the hls reload bug, feed it the sequence header.
- v0.9, 2013年12月15日, refine protocol, use int64_t timestamp for ts and jitter.
- v0.9, 2013年12月15日, support set the live queue length(in seconds), drop when full.
- v0.9, 2013年12月15日, fix the forwarder reconnect bug, feed it the sequence header.
- v0.9, 2013年12月15日, support reload the hls/forwarder/transcoder.
- v0.9, 2013年12月14日, refine the thread model for the retry threads.
- v0.9, 2013年12月10日, auto install depends tools/libs on centos/ubuntu.
- v0.8, 2013年12月08日, v0.8 released. 19186 lines.
- v0.8, 2013年12月08日, support http hooks: on_connect/close/publish/unpublish/play/stop.
- v0.8, 2013年12月08日, support multiple http hooks for a event.
- v0.8, 2013年12月07日, support http callback hooks, on_connect.
- v0.8, 2013年12月07日, support network based cli and json result, add CherryPy 3.2.4.
- v0.8, 2013年12月07日, update http/hls/rtmp load test tool st_load, use SRS rtmp sdk.
- v0.8, 2013年12月06日, support max_connections, drop if exceed.
- v0.8, 2013年12月05日, support log_dir, write ffmpeg log to file.
- v0.8, 2013年12月05日, fix the forward/hls/encoder bug.
- v0.7, 2013年12月03日, v0.7 released. 17605 lines.
- v0.7, 2013年12月01日, support dead-loop detect for forwarder and transcoder.
- v0.7, 2013年12月01日, support all ffmpeg filters and params.
- v0.7, 2013年11月30日, support live stream transcoder by ffmpeg.
- v0.7, 2013年11月30日, support --with/without -ffmpeg, build ffmpeg-2.1.
- v0.7, 2013年11月30日, 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.
- v0.6, 2013年11月29日, support forward stream to other edge server.
- v0.6, 2013年11月29日, support forward stream to other origin server.
- v0.6, 2013年11月28日, fix memory leak bug, aac decode bug.
- v0.6, 2013年11月27日, support --with or --without -hls and -ssl options.
- v0.6, 2013年11月27日, support AAC 44100HZ sample rate for iphone, adjust the timestamp.
- v0.5, 2013年11月26日, v0.5 released. 14449 lines.
- v0.5, 2013年11月24日, support HLS(m3u8), fragment and window.
- v0.5, 2013年11月24日, support record to ts file for HLS.
- v0.5, 2013年11月21日, add ts_info tool to demux ts file.
- v0.5, 2013年11月16日, add rtmp players(OSMF/jwplayer5/jwplayer6).
- v0.4, 2013年11月10日, v0.4 released. 12500 lines.
- v0.4, 2013年11月10日, support config and reload the pithy print.
- v0.4, 2013年11月09日, support reload config(vhost and its detail).
- v0.4, 2013年11月09日, support reload config(listen and chunk_size) by SIGHUP(1).
- v0.4, 2013年11月09日, support longtime(>4.6hours) publish/play.
- v0.4, 2013年11月09日, support config the chunk_size.
- v0.4, 2013年11月09日, support pause for live stream.
- v0.3, 2013年11月04日, v0.3 released. 11773 lines.
- v0.3, 2013年11月04日, support refer/play-refer/publish-refer.
- v0.3, 2013年11月04日, support vhosts specified config.
- v0.3, 2013年11月02日, support listen multiple ports.
- v0.3, 2013年11月02日, support config file in nginx-conf style.
- v0.3, 2013年10月29日, support pithy print log message specified by stage.
- v0.3, 2013年10月28日, support librtmp without extended-timestamp in 0xCX chunk packet.
- v0.3, 2013年10月27日, support cache last gop for client fast startup.
- v0.2, 2013年10月25日, v0.2 released. 10125 lines.
- v0.2, 2013年10月25日, support flash publish.
- v0.2, 2013年10月25日, support h264/avc codec by rtmp complex handshake.
- v0.2, 2013年10月24日, support time jitter detect and correct algorithm
- v0.2, 2013年10月24日, support decode codec type to cache the h264/avc sequence header.
- v0.1, 2013年10月23日, v0.1 released. 8287 lines.
- v0.1, 2013年10月23日, support basic amf0 codec, simplify the api using c-style api.
- v0.1, 2013年10月23日, support shared ptr msg for zero memory copy.
- v0.1, 2013年10月22日, support vp6 codec with rtmp protocol specified simple handshake.
- v0.1, 2013年10月20日, support multiple flash client play live streaming.
- v0.1, 2013年10月20日, support FMLE/FFMPEG publish live streaming.
- v0.1, 2013年10月18日, support rtmp message2chunk protocol(send_message).
- v0.1, 2013年10月17日, support rtmp chunk2message protocol(recv_message).
- 300 connections, 150Mbps, 500kbps, CPU 18.8%, MEM 5956KB.
- 600 connections, 300Mbps, 500kbps, CPU 32.1%, MEM 9808KB.
- 900 connections, 450Mbps, 500kbps, CPU 49.9%, MEM 11MB.
- 1200 connections, 600Mbps, 500kbps, CPU 72.4%, MEM 15MB.
- 1500 connections, 750Mbps, 500kbps, CPU 81.9%, MEM 28MB.
- 1800 connections, 900Mbps, 500kbps, CPU 90.2%, MEM 41MB.
[winlin@dev6 srs]$ dstat ----total-cpu-usage---- -dsk/total- ---net/lo-- ---paging-- ---system-- usr sys idl wai hiq siq| read writ| recv send| in out | int csw 58 9 32 0 0 1| 0 4168k| 277M 277M| 0 0 | 29k 25k 61 8 30 0 0 1| 0 1168k| 336M 336M| 0 0 | 29k 24k 63 8 27 0 0 1| 0 2240k| 124M 124M| 0 0 | 32k 33k 62 8 28 0 0 1| 0 1632k| 110M 110M| 0 0 | 31k 33k 53 7 40 0 0 1| 0 1360k| 115M 115M| 0 0 | 24k 26k 51 7 41 0 0 1| 0 1184k| 146M 146M| 0 0 | 24k 27k 39 6 54 0 0 1| 0 1284k| 105M 105M| 0 0 | 22k 28k 41 6 52 0 0 1| 0 1264k| 116M 116M| 0 0 | 25k 28k 48 6 45 0 0 1| 0 1272k| 143M 143M| 0 0 | 27k 27k
- See also: Performance for x86/x64 Test Guide
- See also: Performance for RaspberryPi
- SRS v1.0-mainline2: 35255 lines. support android, dvr and edge.
- SRS v1.0-mainline: 30000 lines. support arm, init.d scripts, http server and api, ingest.
- SRS v0.9: 20926 lines. player/encoder/chat demos. bandwidth test for encoder/CDN.
- SRS v0.8: 19186 lines. implements http hooks refer to nginx-rtmp.
- SRS v0.7: 17605 lines. implements transcoding(FFMPEG) feature refer to wowza.
- SRS v0.6: 16094 lines. important feature forward for CDN.
- SRS v0.5: 14449 lines. implements HLS feature refer to nginx-rtmp.
- SRS v0.4: 12500 lines. important feature reload for CDN.
- SRS v0.3: 11773 lines. implements vhost feature refer to FMS.
- SRS v0.2: 10125 lines. implements rtmp protocol stack refer to nginx-rtmp.
- SRS v0.1: 8287 lines. base on state-threads.
- nginx-rtmp v1.0.4: 26786 lines
- nginx v1.5.0: 139524 lines
SRS always use the most simple architecture to support complex transaction.
- System arch: the system structure and arch.
- Modularity arch: the main modularity of SRS.
- Stream arch: the stream dispatch arch of SRS.
- RTMP cluster arch: the RTMP origin and edge cluster arch.
- Multiple processes arch (by wenjie): the multiple process of SRS.
- CLI arch: the cli arch for SRS, api to manage SRS.
- Bandwidth specification: the bandwidth test specification of SRS.
+------------------------------------------------------+ | SRS(Simple RTMP Server) | +---------------+---------------+-----------+----------+ | API/hook | Transcoder | HLS | RTMP | | http-parser | FFMPEG/x264 | NGINX/ts | protocol | +---------------+---------------+-----------+----------+ | Network(state-threads) | +------------------------------------------------------+ | All Linux(RHEL,CentOS,Ubuntu,Fedora...) | +------------------------------------------------------+
+------------------------------------------------------+ | Main(srs/bandwidth/librtmp) | +------------------------------------------------------+ | App(Server/Client application) | +------------------------------------------------------+ | RTMP(Protocol stack) | +------------------------------------------------------+ | Kernel(depends on Core, provides error/log) | +------------------------------------------------------+ | Core(depends only on system apis) | +------------------------------------------------------+
+---------+ +----------+ + Publish + + Deliver | +---|-----+ +----|-----+ +----------------------+-------------------------+----------------+ | Input | SRS(Simple RTMP Server) | Output | +----------------------+-------------------------+----------------+ | Encoder(1) | +-> RTMP protocol ----+-> Flash Player | | (FMLE,FFMPEG, -rtmp-+->-+-> HLS/NGINX --------+-> m3u8 player | | Flash,XSPLIT, | +-> Fowarder ---------+-> RTMP Server | | ......) | +-> Transcoder -------+-> RTMP Server | | | +-> DVR --------------+-> FILE | | | +-> BandwidthTest ----+-> Flash/StLoad | +----------------------+ | | | MediaSource(2) | | | | (RTSP,FILE, | | | | HTTP,HLS, ------+->-- Ingester ----(rtmp)-+-> SRS | | Device, | | | | ......) | | | +----------------------+-------------------------+----------------+ Remark: (1) Encoder: encoder must push RTMP stream to SRS server. (2) MediaSource: any media source, which can be ingest by ffmpeg. (3) Ingester: SRS will fork a process to run ffmpeg(or your application) to ingest any input to rtmp, push to SRS.
+----------+ +----------+ +--ATC->-+ server +--ATC->-+ packager +-+ +---------+ +----------+ | RTMP +----------+ RTMP +----------+ | | Reverse | +-------+ | encoder +->-+ +->-+ Proxy +-->-+ CDN + +----------+ | +----------+ +----------+ | | (nginx) | +-------+ +--ATC->-+ server +--ATC->-+ packager +-+ +---------+ RTMP +----------+ RTMP +----------+
Remark: cluster over forward, see Cluster Remark: cluster over edge, see Edge
+---------+ +-----------------+ +-----------------------+ + Encoder +--+-->-+ SRS(RTMP Edge) +--->-+ (RTMP Origin) | +---------+ | +-----------------+ | SRS/FMS/NGINX-RTMP | | | Red5/HELIX/CRTMP | +-------------------------->-+ ...... | +-----------------------+ Schema#1: Any RTMP encoder push RTMP stream to RTMP (origin/edge)server, where SRS RTMP Edge server will forward stream to origin. +-------------+ +-----------------+ +--------------------+ | RTMP Origin +-->-+ SRS(RTMP Edge) +--+->-+ Client(RTMP/HLS) | +-------------+ +-----------------+ | | Flash/IOS/Android | | +--------------------+ | | +-----------------+ +->-+ SRS(RTMP Edge) + +-----------------+ Schema#2: SRS RTMP Edge server pull stream from origin (or upstream SRS RTMP Edge server), then delivery to Client.
+---------------+ +--------+ | upnode server | + client + +-------+-------+ +---+----+ -------------+------------network-------+--------- | | +--------+ +----+-----------+ +----+----------+ | master +--fork->-+ back source(1) +-->-pull-+ stream 1-N(2) + +---+----+ +----------------+ +-------+-------+ | | +-------------------------------------fork--->-----+ | +-------------+ +-------------------fork-->-+ http/vod(3) | +-------------+ Remark: (1) back source process: create by master process, get stream from upnode server if edge, create stream if origin, serve the stream process. (2) stream process: create by master process, get stream from back source process, serve the client. (3) the embeded mininum http server, also provides vod service. for http server, it provides http api, hls(live/vod) delivery. for vod server, it slice the file to hls(m3u8/ts). Remark: (a) This multiple processes architecture is design by wenjie, it's a very simple and powerful multiple process architecture, for the master no need to pass between stream process. (b) The CLI architecture is similar to this, instead, cli process will collect informations from all stream process, master process only send signals to child processes.
+---------+ +--+ stream1 +---------+ | +---------+ | +--------+ | +---------+ | +-------+ | master +--fork->-+--+ streamN +---amf0--+>--+ cli + +--------+ | +---------+ | +-------+ | +-------------+ | +--+ back source +-----+ +-------------+ Remark: (1) master listen the global api port, for example, 33330 (2) back source and stream processes listen at private api port, for example, 33331, 33332, 33333 (3) work processes(stream and back-source), report private api port to master global api port. (4) cli connect to master global api port, get all other private api ports (5) cli connect to each stream/back-source process to get api data, cli analysis and summary the data, return to user.
+--DVR------>-(flv file) +----------+ +-----+ | | encoder +--RTMP-->-+ SRS +-->--+ +----------+ +-----+ | | +------------+ +---HTTP-->-+ P2P system + callback +------------+
Remark: P2P system provides by chnvideo.com
注意:FlashP2P系统为chnvideo.com商业方案,SRS只是支持对接。
+------------+ +----------+ | Client | | Server | +-----+------+ +-----+----+ | | | connect vhost-------------> | | <-----------result(success) | | | | <----------call(start play) | | result(playing)----------> | | <-------------data(playing) | | <-----------call(stop play) | | result(stopped)----------> | | | | <-------call(start publish) | | result(publishing)-------> | | data(publishing)---------> | | <--------call(stop publish) | | result(stopped)(1)-------> | | | | <--------------------report | | final(2)-----------------> | | <END> | @See: class SrsBandwidth comments.
Beijing, 2013.10
Winlin