mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
update readme
This commit is contained in:
parent
d911c85a12
commit
63cec6f967
2 changed files with 21 additions and 12 deletions
22
README.md
22
README.md
|
@ -12,7 +12,7 @@ see also: [http://winlinvip.github.io/simple-rtmp-server](http://winlinvip.githu
|
||||||
winlin(winterserver): [http://blog.csdn.net/win_lin](http://blog.csdn.net/win_lin)
|
winlin(winterserver): [http://blog.csdn.net/win_lin](http://blog.csdn.net/win_lin)
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
step 1: build srs <br/>
|
<strong>step 1:</strong> build srs <br/>
|
||||||
<pre>
|
<pre>
|
||||||
tar xf simple-rtmp-server-*.*.tar.gz
|
tar xf simple-rtmp-server-*.*.tar.gz
|
||||||
cd simple-rtmp-server-*.*/trunk
|
cd simple-rtmp-server-*.*/trunk
|
||||||
|
@ -25,23 +25,23 @@ git clone https://github.com/winlinvip/simple-rtmp-server
|
||||||
cd simple-rtmp-server/trunk
|
cd simple-rtmp-server/trunk
|
||||||
./configure --with-ssl --with-hls --with-ffmpeg --with-http
|
./configure --with-ssl --with-hls --with-ffmpeg --with-http
|
||||||
</pre>
|
</pre>
|
||||||
step 2: start srs <br/>
|
<strong>step 2:</strong> start srs <br/>
|
||||||
<pre>
|
<pre>
|
||||||
./objs/srs -c conf/srs.conf
|
./objs/srs -c conf/srs.conf
|
||||||
</pre>
|
</pre>
|
||||||
step 3(optinal): start srs listen at 19350 to forward to<br/>
|
<strong>step 3(optinal):</strong> start srs listen at 19350 to forward to<br/>
|
||||||
<pre>
|
<pre>
|
||||||
./objs/srs -c conf/srs.19350.conf
|
./objs/srs -c conf/srs.19350.conf
|
||||||
</pre>
|
</pre>
|
||||||
step 4(optional): start nginx for HLS <br/>
|
<strong>step 4(optinal):</strong> start nginx for HLS <br/>
|
||||||
<pre>
|
<pre>
|
||||||
sudo ./objs/nginx/sbin/nginx
|
sudo ./objs/nginx/sbin/nginx
|
||||||
</pre>
|
</pre>
|
||||||
step 5(optional): start http hooks for srs callback <br/>
|
<strong>step 5(optinal):</strong> start http hooks for srs callback <br/>
|
||||||
<pre>
|
<pre>
|
||||||
python ./research/api-server/server.py 8085
|
python ./research/api-server/server.py 8085
|
||||||
</pre>
|
</pre>
|
||||||
step 6: publish live stream <br/>
|
<strong>step 6:</strong> publish live stream <br/>
|
||||||
<pre>
|
<pre>
|
||||||
FMS URL: rtmp://127.0.0.1:1935/live
|
FMS URL: rtmp://127.0.0.1:1935/live
|
||||||
Stream: livestream
|
Stream: livestream
|
||||||
|
@ -53,7 +53,7 @@ For example, use ffmpeg to publish:
|
||||||
sleep 1; \
|
sleep 1; \
|
||||||
done
|
done
|
||||||
</pre>
|
</pre>
|
||||||
step 7: add server ip to client hosts as demo. <br/>
|
<strong>step 7:</strong> add server ip to client hosts as demo. <br/>
|
||||||
<pre>
|
<pre>
|
||||||
# edit the folowing file:
|
# edit the folowing file:
|
||||||
# linux: /etc/hosts
|
# linux: /etc/hosts
|
||||||
|
@ -61,13 +61,13 @@ step 7: add server ip to client hosts as demo. <br/>
|
||||||
# where server ip is 192.168.2.111
|
# where server ip is 192.168.2.111
|
||||||
192.168.2.111 demo
|
192.168.2.111 demo
|
||||||
</pre>
|
</pre>
|
||||||
step 8: play live stream. <br/>
|
<strong>step 8:</strong> play live stream. <br/>
|
||||||
<pre>
|
<pre>
|
||||||
rtmp url: rtmp://demo:1935/live/livestream
|
rtmp url: rtmp://demo:1935/live/livestream
|
||||||
m3u8 url: http://demo:80/live/livestream.m3u8
|
m3u8 url: http://demo:80/live/livestream.m3u8
|
||||||
for android: http://demo:80/live/livestream.html
|
for android: http://demo:80/live/livestream.html
|
||||||
</pre>
|
</pre>
|
||||||
step 9: play live stream auto transcoded<br/>
|
<strong>step 9(optinal):</strong> play live stream auto transcoded<br/>
|
||||||
<pre>
|
<pre>
|
||||||
rtmp url: rtmp://demo:1935/live/livestream_ld
|
rtmp url: rtmp://demo:1935/live/livestream_ld
|
||||||
m3u8 url: http://demo:80/live/livestream_ld.m3u8
|
m3u8 url: http://demo:80/live/livestream_ld.m3u8
|
||||||
|
@ -76,7 +76,7 @@ rtmp url: rtmp://demo:1935/live/livestream_sd
|
||||||
m3u8 url: http://demo:80/live/livestream_sd.m3u8
|
m3u8 url: http://demo:80/live/livestream_sd.m3u8
|
||||||
for android: http://demo:80/live/livestream_sd.html
|
for android: http://demo:80/live/livestream_sd.html
|
||||||
</pre>
|
</pre>
|
||||||
step 10: play live stream auto forwarded, the hls dir change to /forward<br/>
|
<strong>step 10(optinal):</strong> play live stream auto forwarded, the hls dir change to /forward<br/>
|
||||||
<pre>
|
<pre>
|
||||||
rtmp url: rtmp://demo:19350/live/livestream
|
rtmp url: rtmp://demo:19350/live/livestream
|
||||||
m3u8 url: http://demo:80/forward/live/livestream.m3u8
|
m3u8 url: http://demo:80/forward/live/livestream.m3u8
|
||||||
|
@ -88,7 +88,7 @@ rtmp url: rtmp://demo:19350/live/livestream_sd
|
||||||
m3u8 url: http://demo:80/forward/live/livestream_sd.m3u8
|
m3u8 url: http://demo:80/forward/live/livestream_sd.m3u8
|
||||||
for android: http://demo:80/forward/live/livestream_sd.html
|
for android: http://demo:80/forward/live/livestream_sd.html
|
||||||
</pre>
|
</pre>
|
||||||
step 11: modify the config and reload it (all features support reload)<br/>
|
<strong>step 11(optinal):</strong> modify the config and reload it (all features support reload)<br/>
|
||||||
<pre>
|
<pre>
|
||||||
killall -1 srs
|
killall -1 srs
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
@ -28,6 +28,15 @@ vhost __defaultVhost__ {
|
||||||
hls_fragment 5;
|
hls_fragment 5;
|
||||||
hls_window 30;
|
hls_window 30;
|
||||||
}
|
}
|
||||||
|
http_hooks {
|
||||||
|
enabled off;
|
||||||
|
on_connect http://127.0.0.1:8085/api/v1/clients;
|
||||||
|
on_close http://127.0.0.1:8085/api/v1/clients;
|
||||||
|
on_publish http://127.0.0.1:8085/api/v1/streams;
|
||||||
|
on_unpublish http://127.0.0.1:8085/api/v1/streams;
|
||||||
|
on_play http://127.0.0.1:8085/api/v1/sessions;
|
||||||
|
on_stop http://127.0.0.1:8085/api/v1/sessions;
|
||||||
|
}
|
||||||
transcode {
|
transcode {
|
||||||
enabled on;
|
enabled on;
|
||||||
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
|
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
|
||||||
|
@ -85,7 +94,7 @@ vhost dev {
|
||||||
gop_cache on;
|
gop_cache on;
|
||||||
#forward 127.0.0.1:19350;
|
#forward 127.0.0.1:19350;
|
||||||
hls {
|
hls {
|
||||||
enabled on;
|
enabled off;
|
||||||
hls_path ./objs/nginx/html;
|
hls_path ./objs/nginx/html;
|
||||||
hls_fragment 5;
|
hls_fragment 5;
|
||||||
hls_window 30;
|
hls_window 30;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue