winlin

refine readme.

@@ -21,52 +21,52 @@ people who have submitted patches, reported bugs, added translations, helped<br/ @@ -21,52 +21,52 @@ people who have submitted patches, reported bugs, added translations, helped<br/
21 answer newbie questions, and generally made SRS that much better: [AUTHORS.txt](https://github.com/winlinvip/simple-rtmp-server/blob/master/AUTHORS.txt) 21 answer newbie questions, and generally made SRS that much better: [AUTHORS.txt](https://github.com/winlinvip/simple-rtmp-server/blob/master/AUTHORS.txt)
22 22
23 ### Usage(simple) 23 ### Usage(simple)
24 -<strong>step -1:</strong> get SRS<br/> 24 +<strong>Step -1:</strong> get SRS<br/>
25 <pre> 25 <pre>
26 git clone https://github.com/winlinvip/simple-rtmp-server && 26 git clone https://github.com/winlinvip/simple-rtmp-server &&
27 cd simple-rtmp-server/trunk 27 cd simple-rtmp-server/trunk
28 </pre> 28 </pre>
29 -<strong>step 0:</strong> build SRS system.<br/> 29 +<strong>Step 0:</strong> build SRS system.<br/>
30 <pre> 30 <pre>
31 bash scripts/build.sh 31 bash scripts/build.sh
32 </pre> 32 </pre>
33 -<strong>step 1:</strong> start SRS all demo features.<br/> 33 +<strong>Step 1:</strong> start SRS all demo features.<br/>
34 <pre> 34 <pre>
35 bash scripts/run.sh 35 bash scripts/run.sh
36 </pre> 36 </pre>
37 -<strong>step 2:</strong> SRS live show: [http://your-server-ip](http://your-server-ip) <br/>  
38 -<strong>step 3:</strong> stop SRS demo<br/> 37 +<strong>Step 2:</strong> SRS live show: [http://your-server-ip](http://your-server-ip) <br/>
  38 +<strong>Step 3:</strong> stop SRS demo<br/>
39 <pre> 39 <pre>
40 bash scripts/stop.sh 40 bash scripts/stop.sh
41 </pre> 41 </pre>
42 42
43 ### Usage(detail) 43 ### Usage(detail)
44 -<strong>step 0:</strong> get SRS <br/> 44 +<strong>Step 0:</strong> get SRS <br/>
45 <pre> 45 <pre>
46 git clone https://github.com/winlinvip/simple-rtmp-server && 46 git clone https://github.com/winlinvip/simple-rtmp-server &&
47 cd simple-rtmp-server/trunk 47 cd simple-rtmp-server/trunk
48 </pre> 48 </pre>
49 -<strong>step 1:</strong> build SRS <br/> 49 +<strong>Step 1:</strong> build SRS <br/>
50 <pre> 50 <pre>
51 ./configure --with-ssl --with-hls --with-ffmpeg --with-http && make 51 ./configure --with-ssl --with-hls --with-ffmpeg --with-http && make
52 </pre> 52 </pre>
53 -<strong>step 2:</strong> start SRS <br/> 53 +<strong>Step 2:</strong> start SRS <br/>
54 <pre> 54 <pre>
55 ./objs/srs -c conf/srs.conf 55 ./objs/srs -c conf/srs.conf
56 </pre> 56 </pre>
57 -<strong>step 3(optinal):</strong> start SRS listen at 19350 to forward to<br/> 57 +<strong>Step 3(optinal):</strong> start SRS listen at 19350 to forward to<br/>
58 <pre> 58 <pre>
59 ./objs/srs -c conf/srs.19350.conf 59 ./objs/srs -c conf/srs.19350.conf
60 </pre> 60 </pre>
61 -<strong>step 4(optinal):</strong> start nginx for HLS <br/> 61 +<strong>Step 4(optinal):</strong> start nginx for HLS <br/>
62 <pre> 62 <pre>
63 sudo ./objs/nginx/sbin/nginx 63 sudo ./objs/nginx/sbin/nginx
64 </pre> 64 </pre>
65 -<strong>step 5(optinal):</strong> start http hooks for SRS callback <br/> 65 +<strong>Step 5(optinal):</strong> start http hooks for SRS callback <br/>
66 <pre> 66 <pre>
67 python ./research/api-server/server.py 8085 67 python ./research/api-server/server.py 8085
68 </pre> 68 </pre>
69 -<strong>step 6:</strong> publish demo live stream <br/> 69 +<strong>Step 6:</strong> publish demo live stream <br/>
70 <pre> 70 <pre>
71 FMS URL: rtmp://127.0.0.1/live?vhost=demo.srs.com 71 FMS URL: rtmp://127.0.0.1/live?vhost=demo.srs.com
72 Stream: livestream 72 Stream: livestream
@@ -78,7 +78,7 @@ FFMPEG to publish the default demo stream: @@ -78,7 +78,7 @@ FFMPEG to publish the default demo stream:
78 sleep 1; \ 78 sleep 1; \
79 done 79 done
80 </pre> 80 </pre>
81 -<strong>step 7:</strong> publish players live stream <br/> 81 +<strong>Step 7:</strong> publish players live stream <br/>
82 <pre> 82 <pre>
83 FMS URL: rtmp://127.0.0.1/live?vhost=players 83 FMS URL: rtmp://127.0.0.1/live?vhost=players
84 Stream: livestream 84 Stream: livestream
@@ -90,7 +90,7 @@ FFMPEG to publish the players demo stream: @@ -90,7 +90,7 @@ FFMPEG to publish the players demo stream:
90 sleep 1; \ 90 sleep 1; \
91 done 91 done
92 </pre> 92 </pre>
93 -<strong>step 8:</strong> add server ip to client hosts as demo. <br/> 93 +<strong>Step 8:</strong> add server ip to client hosts as demo. <br/>
94 <pre> 94 <pre>
95 # edit the folowing file: 95 # edit the folowing file:
96 # linux: /etc/hosts 96 # linux: /etc/hosts
@@ -98,14 +98,14 @@ FFMPEG to publish the players demo stream: @@ -98,14 +98,14 @@ FFMPEG to publish the players demo stream:
98 # where server ip is 192.168.2.111 98 # where server ip is 192.168.2.111
99 192.168.2.111 demo.srs.com 99 192.168.2.111 demo.srs.com
100 </pre> 100 </pre>
101 -<strong>step 9:</strong> play live stream. <br/> 101 +<strong>Step 9:</strong> play live stream. <br/>
102 <pre> 102 <pre>
103 players: http://demo.srs.com/players 103 players: http://demo.srs.com/players
104 rtmp url: rtmp://demo.srs.com/live/livestream 104 rtmp url: rtmp://demo.srs.com/live/livestream
105 m3u8 url: http://demo.srs.com/live/livestream.m3u8 105 m3u8 url: http://demo.srs.com/live/livestream.m3u8
106 for android: http://demo.srs.com/live/livestream.html 106 for android: http://demo.srs.com/live/livestream.html
107 </pre> 107 </pre>
108 -<strong>step 10(optinal):</strong> play live stream auto transcoded<br/> 108 +<strong>Step 10(optinal):</strong> play live stream auto transcoded<br/>
109 <pre> 109 <pre>
110 rtmp url: rtmp://demo.srs.com/live/livestream_ld 110 rtmp url: rtmp://demo.srs.com/live/livestream_ld
111 m3u8 url: http://demo.srs.com/live/livestream_ld.m3u8 111 m3u8 url: http://demo.srs.com/live/livestream_ld.m3u8
@@ -114,7 +114,7 @@ rtmp url: rtmp://demo.srs.com/live/livestream_sd @@ -114,7 +114,7 @@ rtmp url: rtmp://demo.srs.com/live/livestream_sd
114 m3u8 url: http://demo.srs.com/live/livestream_sd.m3u8 114 m3u8 url: http://demo.srs.com/live/livestream_sd.m3u8
115 for android: http://demo.srs.com/live/livestream_sd.html 115 for android: http://demo.srs.com/live/livestream_sd.html
116 </pre> 116 </pre>
117 -<strong>step 11(optinal):</strong> play live stream auto forwarded, the hls dir change to /forward<br/> 117 +<strong>Step 11(optinal):</strong> play live stream auto forwarded, the hls dir change to /forward<br/>
118 <pre> 118 <pre>
119 rtmp url: rtmp://demo.srs.com:19350/live/livestream 119 rtmp url: rtmp://demo.srs.com:19350/live/livestream
120 m3u8 url: http://demo.srs.com/forward/live/livestream.m3u8 120 m3u8 url: http://demo.srs.com/forward/live/livestream.m3u8
@@ -126,7 +126,7 @@ rtmp url: rtmp://demo.srs.com:19350/live/livestream_sd @@ -126,7 +126,7 @@ rtmp url: rtmp://demo.srs.com:19350/live/livestream_sd
126 m3u8 url: http://demo.srs.com/forward/live/livestream_sd.m3u8 126 m3u8 url: http://demo.srs.com/forward/live/livestream_sd.m3u8
127 for android: http://demo.srs.com/forward/live/livestream_sd.html 127 for android: http://demo.srs.com/forward/live/livestream_sd.html
128 </pre> 128 </pre>
129 -<strong>step 12(optinal):</strong> modify the config and reload it (all features support reload)<br/> 129 +<strong>Step 12(optinal):</strong> modify the config and reload it (all features support reload)<br/>
130 <pre> 130 <pre>
131 killall -1 srs 131 killall -1 srs
132 </pre> 132 </pre>
@@ -190,7 +190,7 @@ Bandwidth Test Workflow: @@ -190,7 +190,7 @@ Bandwidth Test Workflow:
190 | final(2)-----------------> | 190 | final(2)-----------------> |
191 | &lt;END> | 191 | &lt;END> |
192 192
193 -@see: class SrsBandwidth comments. 193 +@See: class SrsBandwidth comments.
194 </pre> 194 </pre>
195 195
196 ### System Requirements 196 ### System Requirements
@@ -199,37 +199,38 @@ Supported operating systems and hardware: @@ -199,37 +199,38 @@ Supported operating systems and hardware:
199 * All handware. 199 * All handware.
200 200
201 ### Summary 201 ### Summary
202 -1. simple: also stable enough.<br/>  
203 -2. high-performance: single-thread, async socket, event/st-thread driven.<br/>  
204 -3. no edge server, origin server only.<br/>  
205 -4. no vod streaming, live streaming only.<br/>  
206 -5. no multiple processes, single process only.<br/>  
207 -6. support vhost, support \_\_defaultVhost\_\_.<br/>  
208 -7. support adobe rtmp live streaming.<br/>  
209 -8. support apple hls(m3u8) live streaming.<br/>  
210 -9. support reload config to enable changes.<br/>  
211 -10. support cache last gop for flash player to fast startup.<br/>  
212 -11. support listen at multiple ports.<br/>  
213 -12. support long time(>4.6hours) publish/play.<br/>  
214 -13. high performace, 1800 connections(500kbps), 900Mbps, CPU 90.2%, 41MB<br/>  
215 -14. support forward publish stream to build active-standby cluster.<br/>  
216 -15. support broadcast by forward the stream to other servers(origin/edge).<br/>  
217 -16. support live stream transcoding by ffmpeg.<br/>  
218 -17. support live stream forward(acopy/vcopy) by ffmpeg.<br/>  
219 -18. support ffmpeg filters(logo/overlay/crop), x264 params.<br/>  
220 -19. support audio transcode only, speex/mp3 to aac<br/>  
221 -20. support http callback api hooks(for authentication and injection).<br/>  
222 -21. support bandwidth test api and flash client.<br/>  
223 -22. player, publisher(encoder), and demo pages(jquery+bootstrap). <br/>  
224 -23. demo video meeting or chat(SRS+cherrypy+jquery+bootstrap). <br/>  
225 -24. [plan] support network based cli and json result.<br/>  
226 -25. [plan] support adobe flash refer/token/swf verification.<br/>  
227 -26. [plan] support adobe amf3 codec.<br/>  
228 -27. [plan] support dvr(record live to vod file)<br/>  
229 -28. [plan] support FMS edge protocol<br/>  
230 -29. [plan] support encryption: RTMPE/RTMPS, HLS DRM<br/>  
231 -30. [plan] support RTMPT, http to tranverse firewalls<br/>  
232 -31. [plan] support file source, transcoding file to live stream<br/> 202 +1. Simple: also stable enough.<br/>
  203 +2. High-performance: single-thread, async socket, event/st-thread driven.<br/>
  204 +3. NO edge server, origin server only.<br/>
  205 +4. NO vod streaming, live streaming only.<br/>
  206 +5. NO multiple processes, single process only.<br/>
  207 +6. Support vhost, support \_\_defaultVhost\_\_.<br/>
  208 +7. Support adobe rtmp live streaming.<br/>
  209 +8. Support apple hls(m3u8) live streaming.<br/>
  210 +9. Support reload config to enable changes.<br/>
  211 +10. Support cache last gop for flash player to fast startup.<br/>
  212 +11. Support listen at multiple ports.<br/>
  213 +12. Support long time(>4.6hours) publish/play.<br/>
  214 +13. High performace, 1800 connections(500kbps), 900Mbps, CPU 90.2%, 41MB<br/>
  215 +14. Support forward publish stream to build active-standby cluster.<br/>
  216 +15. Support broadcast by forward the stream to other servers(origin/edge).<br/>
  217 +16. Support live stream transcoding by ffmpeg.<br/>
  218 +17. Support live stream forward(acopy/vcopy) by ffmpeg.<br/>
  219 +18. Support ffmpeg filters(logo/overlay/crop), x264 params.<br/>
  220 +19. Support audio transcode only, speex/mp3 to aac<br/>
  221 +20. Support http callback api hooks(for authentication and injection).<br/>
  222 +21. Support bandwidth test api and flash client.<br/>
  223 +22. Player, publisher(encoder), and demo pages(jquery+bootstrap). <br/>
  224 +23. Demo video meeting or chat(SRS+cherrypy+jquery+bootstrap). <br/>
  225 +24. [dev] Full documents in wiki, in chineses. <br/>
  226 +25. [plan] Support network based cli and json result.<br/>
  227 +26. [plan] Support adobe flash refer/token/swf verification.<br/>
  228 +27. [plan] Support adobe amf3 codec.<br/>
  229 +28. [plan] Support dvr(record live to vod file)<br/>
  230 +29. [plan] Support FMS edge protocol<br/>
  231 +30. [plan] Support encryption: RTMPE/RTMPS, HLS DRM<br/>
  232 +31. [plan] Support RTMPT, http to tranverse firewalls<br/>
  233 +32. [plan] Support file source, transcoding file to live stream<br/>
233 234
234 ### Performance 235 ### Performance
235 1. 300 connections, 150Mbps, 500kbps, CPU 18.8%, 5956KB. 236 1. 300 connections, 150Mbps, 500kbps, CPU 18.8%, 5956KB.
@@ -239,6 +240,7 @@ Supported operating systems and hardware: @@ -239,6 +240,7 @@ Supported operating systems and hardware:
239 5. 1500 connections, 750Mbps, 500kbps, CPU 81.9%, 28MB. 240 5. 1500 connections, 750Mbps, 500kbps, CPU 81.9%, 28MB.
240 6. 1800 connections, 900Mbps, 500kbps, CPU 90.2%, 41MB. 241 6. 1800 connections, 900Mbps, 500kbps, CPU 90.2%, 41MB.
241 <pre> 242 <pre>
  243 +[winlin@dev6 srs]$ dstat
242 ----total-cpu-usage---- -dsk/total- ---net/lo-- ---paging-- ---system-- 244 ----total-cpu-usage---- -dsk/total- ---net/lo-- ---paging-- ---system--
243 usr sys idl wai hiq siq| read writ| recv send| in out | int csw 245 usr sys idl wai hiq siq| read writ| recv send| in out | int csw
244 58 9 32 0 0 1| 0 4168k| 277M 277M| 0 0 | 29k 25k 246 58 9 32 0 0 1| 0 4168k| 277M 277M| 0 0 | 29k 25k
@@ -257,16 +259,16 @@ usr sys idl wai hiq siq| read writ| recv send| in out | int csw @@ -257,16 +259,16 @@ usr sys idl wai hiq siq| read writ| recv send| in out | int csw
257 </pre> 259 </pre>
258 260
259 ### Releases 261 ### Releases
260 -* 2013-12-25, [release v0.9](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.9), support bandwidth test, add player/encoder/chat demos. 20926 lines.<br/>  
261 -* 2013-12-08, [release v0.8](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.8), support http hooks callback, update [st_load](https://github.com/winlinvip/st-load). 19186 lines.<br/>  
262 -* 2013-12-03, [release v0.7](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.7), support live stream transcoding. 17605 lines.<br/>  
263 -* 2013-11-29, [release v0.6](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.6), support forward stream to origin/edge. 16094 lines.<br/>  
264 -* 2013-11-26, [release v0.5](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.5), support HLS(m3u8), fragment and window. 14449 lines.<br/>  
265 -* 2013-11-10, [release v0.4](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.4), support reload config, pause, longtime publish/play. 12500 lines.<br/>  
266 -* 2013-11-04, [release v0.3](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.3), support vhost, refer, gop cache, listen multiple ports. 11773 lines.<br/>  
267 -* 2013-10-25, [release v0.2](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.2), support rtmp flash publish, h264, time jitter correct. 10125 lines.<br/>  
268 -* 2013-10-23, [release v0.1](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.1), support rtmp FMLE/FFMPEG publish, vp6. 8287 lines.<br/>  
269 -* 2013-10-17, created.<br/> 262 +* 2013-12-25, [Release v0.9](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.9), support bandwidth test, add player/encoder/chat demos. 20926 lines.<br/>
  263 +* 2013-12-08, [Release v0.8](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.8), support http hooks callback, update [st_load](https://github.com/winlinvip/st-load). 19186 lines.<br/>
  264 +* 2013-12-03, [Release v0.7](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.7), support live stream transcoding. 17605 lines.<br/>
  265 +* 2013-11-29, [Release v0.6](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.6), support forward stream to origin/edge. 16094 lines.<br/>
  266 +* 2013-11-26, [Release v0.5](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.5), support HLS(m3u8), fragment and window. 14449 lines.<br/>
  267 +* 2013-11-10, [Release v0.4](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.4), support reload config, pause, longtime publish/play. 12500 lines.<br/>
  268 +* 2013-11-04, [Release v0.3](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.3), support vhost, refer, gop cache, listen multiple ports. 11773 lines.<br/>
  269 +* 2013-10-25, [Release v0.2](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.2), support rtmp flash publish, h264, time jitter correct. 10125 lines.<br/>
  270 +* 2013-10-23, [Release v0.1](https://github.com/winlinvip/simple-rtmp-server/releases/tag/0.1), support rtmp FMLE/FFMPEG publish, vp6. 8287 lines.<br/>
  271 +* 2013-10-17, Created.<br/>
270 272
271 ### Compare 273 ### Compare
272 * SRS v0.9: 20926 lines. player/encoder/chat demos. bandwidth test for encoder/CDN.<br/> 274 * SRS v0.9: 20926 lines. player/encoder/chat demos. bandwidth test for encoder/CDN.<br/>
@@ -76,7 +76,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -76,7 +76,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
76 #define RTMP_SIG_SRS_URL "https://"RTMP_SIG_SRS_URL_SHORT 76 #define RTMP_SIG_SRS_URL "https://"RTMP_SIG_SRS_URL_SHORT
77 #define RTMP_SIG_SRS_URL_SHORT "github.com/winlinvip/simple-rtmp-server" 77 #define RTMP_SIG_SRS_URL_SHORT "github.com/winlinvip/simple-rtmp-server"
78 #define RTMP_SIG_SRS_WEB "http://blog.csdn.net/win_lin" 78 #define RTMP_SIG_SRS_WEB "http://blog.csdn.net/win_lin"
79 -#define RTMP_SIG_SRS_EMAIL "winterserver@126.com" 79 +#define RTMP_SIG_SRS_EMAIL "winlin@vip.126.com"
80 #define RTMP_SIG_SRS_LICENSE "The MIT License (MIT)" 80 #define RTMP_SIG_SRS_LICENSE "The MIT License (MIT)"
81 #define RTMP_SIG_SRS_COPYRIGHT "Copyright (c) 2013-2014 winlin" 81 #define RTMP_SIG_SRS_COPYRIGHT "Copyright (c) 2013-2014 winlin"
82 #define RTMP_SIG_SRS_PRIMARY_AUTHROS "winlin,wenjiegit" 82 #define RTMP_SIG_SRS_PRIMARY_AUTHROS "winlin,wenjiegit"
@@ -1664,4 +1664,3 @@ bool srs_directive_equals(SrsConfDirective* a, SrsConfDirective* b) @@ -1664,4 +1664,3 @@ bool srs_directive_equals(SrsConfDirective* a, SrsConfDirective* b)
1664 1664
1665 return true; 1665 return true;
1666 } 1666 }
1667 -  
@@ -1184,4 +1184,3 @@ int SrsRtmp::identify_flash_publish_client(SrsPublishPacket* req, SrsClientType& @@ -1184,4 +1184,3 @@ int SrsRtmp::identify_flash_publish_client(SrsPublishPacket* req, SrsClientType&
1184 1184
1185 return ret; 1185 return ret;
1186 } 1186 }
1187 -