winlin

update readme

@@ -12,7 +12,7 @@ see also: [http://winlinvip.github.io/simple-rtmp-server](http://winlinvip.githu @@ -12,7 +12,7 @@ see also: [http://winlinvip.github.io/simple-rtmp-server](http://winlinvip.githu
12 winlin(winterserver): [http://blog.csdn.net/win_lin](http://blog.csdn.net/win_lin) 12 winlin(winterserver): [http://blog.csdn.net/win_lin](http://blog.csdn.net/win_lin)
13 13
14 ### Usage 14 ### Usage
15 -step 1: build srs <br/> 15 +<strong>step 1:</strong> build srs <br/>
16 <pre> 16 <pre>
17 tar xf simple-rtmp-server-*.*.tar.gz 17 tar xf simple-rtmp-server-*.*.tar.gz
18 cd simple-rtmp-server-*.*/trunk 18 cd simple-rtmp-server-*.*/trunk
@@ -25,23 +25,23 @@ git clone https://github.com/winlinvip/simple-rtmp-server @@ -25,23 +25,23 @@ git clone https://github.com/winlinvip/simple-rtmp-server
25 cd simple-rtmp-server/trunk 25 cd simple-rtmp-server/trunk
26 ./configure --with-ssl --with-hls --with-ffmpeg --with-http 26 ./configure --with-ssl --with-hls --with-ffmpeg --with-http
27 </pre> 27 </pre>
28 -step 2: start srs <br/> 28 +<strong>step 2:</strong> start srs <br/>
29 <pre> 29 <pre>
30 ./objs/srs -c conf/srs.conf 30 ./objs/srs -c conf/srs.conf
31 </pre> 31 </pre>
32 -step 3(optinal): start srs listen at 19350 to forward to<br/> 32 +<strong>step 3(optinal):</strong> start srs listen at 19350 to forward to<br/>
33 <pre> 33 <pre>
34 ./objs/srs -c conf/srs.19350.conf 34 ./objs/srs -c conf/srs.19350.conf
35 </pre> 35 </pre>
36 -step 4(optional): start nginx for HLS <br/> 36 +<strong>step 4(optinal):</strong> start nginx for HLS <br/>
37 <pre> 37 <pre>
38 sudo ./objs/nginx/sbin/nginx 38 sudo ./objs/nginx/sbin/nginx
39 </pre> 39 </pre>
40 -step 5(optional): start http hooks for srs callback <br/> 40 +<strong>step 5(optinal):</strong> start http hooks for srs callback <br/>
41 <pre> 41 <pre>
42 python ./research/api-server/server.py 8085 42 python ./research/api-server/server.py 8085
43 </pre> 43 </pre>
44 -step 6: publish live stream <br/> 44 +<strong>step 6:</strong> publish live stream <br/>
45 <pre> 45 <pre>
46 FMS URL: rtmp://127.0.0.1:1935/live 46 FMS URL: rtmp://127.0.0.1:1935/live
47 Stream: livestream 47 Stream: livestream
@@ -53,7 +53,7 @@ For example, use ffmpeg to publish: @@ -53,7 +53,7 @@ For example, use ffmpeg to publish:
53 sleep 1; \ 53 sleep 1; \
54 done 54 done
55 </pre> 55 </pre>
56 -step 7: add server ip to client hosts as demo. <br/> 56 +<strong>step 7:</strong> add server ip to client hosts as demo. <br/>
57 <pre> 57 <pre>
58 # edit the folowing file: 58 # edit the folowing file:
59 # linux: /etc/hosts 59 # linux: /etc/hosts
@@ -61,13 +61,13 @@ step 7: add server ip to client hosts as demo. <br/> @@ -61,13 +61,13 @@ step 7: add server ip to client hosts as demo. <br/>
61 # where server ip is 192.168.2.111 61 # where server ip is 192.168.2.111
62 192.168.2.111 demo 62 192.168.2.111 demo
63 </pre> 63 </pre>
64 -step 8: play live stream. <br/> 64 +<strong>step 8:</strong> play live stream. <br/>
65 <pre> 65 <pre>
66 rtmp url: rtmp://demo:1935/live/livestream 66 rtmp url: rtmp://demo:1935/live/livestream
67 m3u8 url: http://demo:80/live/livestream.m3u8 67 m3u8 url: http://demo:80/live/livestream.m3u8
68 for android: http://demo:80/live/livestream.html 68 for android: http://demo:80/live/livestream.html
69 </pre> 69 </pre>
70 -step 9: play live stream auto transcoded<br/> 70 +<strong>step 9(optinal):</strong> play live stream auto transcoded<br/>
71 <pre> 71 <pre>
72 rtmp url: rtmp://demo:1935/live/livestream_ld 72 rtmp url: rtmp://demo:1935/live/livestream_ld
73 m3u8 url: http://demo:80/live/livestream_ld.m3u8 73 m3u8 url: http://demo:80/live/livestream_ld.m3u8
@@ -76,7 +76,7 @@ rtmp url: rtmp://demo:1935/live/livestream_sd @@ -76,7 +76,7 @@ rtmp url: rtmp://demo:1935/live/livestream_sd
76 m3u8 url: http://demo:80/live/livestream_sd.m3u8 76 m3u8 url: http://demo:80/live/livestream_sd.m3u8
77 for android: http://demo:80/live/livestream_sd.html 77 for android: http://demo:80/live/livestream_sd.html
78 </pre> 78 </pre>
79 -step 10: play live stream auto forwarded, the hls dir change to /forward<br/> 79 +<strong>step 10(optinal):</strong> play live stream auto forwarded, the hls dir change to /forward<br/>
80 <pre> 80 <pre>
81 rtmp url: rtmp://demo:19350/live/livestream 81 rtmp url: rtmp://demo:19350/live/livestream
82 m3u8 url: http://demo:80/forward/live/livestream.m3u8 82 m3u8 url: http://demo:80/forward/live/livestream.m3u8
@@ -88,7 +88,7 @@ rtmp url: rtmp://demo:19350/live/livestream_sd @@ -88,7 +88,7 @@ rtmp url: rtmp://demo:19350/live/livestream_sd
88 m3u8 url: http://demo:80/forward/live/livestream_sd.m3u8 88 m3u8 url: http://demo:80/forward/live/livestream_sd.m3u8
89 for android: http://demo:80/forward/live/livestream_sd.html 89 for android: http://demo:80/forward/live/livestream_sd.html
90 </pre> 90 </pre>
91 -step 11: modify the config and reload it (all features support reload)<br/> 91 +<strong>step 11(optinal):</strong> modify the config and reload it (all features support reload)<br/>
92 <pre> 92 <pre>
93 killall -1 srs 93 killall -1 srs
94 </pre> 94 </pre>
@@ -28,6 +28,15 @@ vhost __defaultVhost__ { @@ -28,6 +28,15 @@ vhost __defaultVhost__ {
28 hls_fragment 5; 28 hls_fragment 5;
29 hls_window 30; 29 hls_window 30;
30 } 30 }
  31 + http_hooks {
  32 + enabled off;
  33 + on_connect http://127.0.0.1:8085/api/v1/clients;
  34 + on_close http://127.0.0.1:8085/api/v1/clients;
  35 + on_publish http://127.0.0.1:8085/api/v1/streams;
  36 + on_unpublish http://127.0.0.1:8085/api/v1/streams;
  37 + on_play http://127.0.0.1:8085/api/v1/sessions;
  38 + on_stop http://127.0.0.1:8085/api/v1/sessions;
  39 + }
31 transcode { 40 transcode {
32 enabled on; 41 enabled on;
33 ffmpeg ./objs/ffmpeg/bin/ffmpeg; 42 ffmpeg ./objs/ffmpeg/bin/ffmpeg;
@@ -85,7 +94,7 @@ vhost dev { @@ -85,7 +94,7 @@ vhost dev {
85 gop_cache on; 94 gop_cache on;
86 #forward 127.0.0.1:19350; 95 #forward 127.0.0.1:19350;
87 hls { 96 hls {
88 - enabled on; 97 + enabled off;
89 hls_path ./objs/nginx/html; 98 hls_path ./objs/nginx/html;
90 hls_fragment 5; 99 hls_fragment 5;
91 hls_window 30; 100 hls_window 30;