Skip to content

Latest commit

 

History

History
executable file
·
261 lines (248 loc) · 13 KB

README.md

File metadata and controls

executable file
·
261 lines (248 loc) · 13 KB

simple-rtmp-server

srs(simple rtmp origin live server) over state-threads.
srs is a simple, high-performance, running in single process, origin live server.
srs supports rtmp, HLS, transcoding, forward, http hooks.
blog: http://blog.csdn.net/win_lin
see also: https://github.com/winlinvip/simple-rtmp-server
see also: http://winlinvip.github.io/simple-rtmp-server

Contributors

winlin(winterserver): http://blog.csdn.net/win_lin

Usage

step 1: build srs

tar xf simple-rtmp-server-*.*.tar.gz
cd simple-rtmp-server-*.*/trunk
./configure --with-ssl --with-hls --with-ffmpeg --with-http
make

step 2: start srs

./objs/simple_rtmp_server -c conf/srs.conf

step 3(optimal): start srs listen at 19350 to forward to

./objs/simple_rtmp_server -c conf/srs.19350.conf

step 4(optional): start nginx for HLS

sudo ./objs/nginx/sbin/nginx

step 5(optional): start http hooks for srs callback

python ./research/api-server/server.py 8085

step 6: publish live stream

FMS URL: rtmp://127.0.0.1:1935/live
Stream:  livestream
For example, use ffmpeg to publish:
    for((;;)); do \
        ./objs/ffmpeg/bin/ffmpeg -re -i ./doc/source.200kbps.768x320.flv \
        -vcodec copy -acodec copy \
        -f flv -y rtmp://127.0.0.1:1935/live/livestream; \
        sleep 1; \
    done

step 7: add server ip to client hosts as demo.

# edit the following file:
# linux: /etc/hosts
# windows: C:\Windows\System32\drivers\etc\hosts
# where server ip is 192.168.2.111
192.168.2.111 demo 

step 8: play live stream.

rtmp url: rtmp://demo:1935/live/livestream
m3u8 url: http://demo:80/live/livestream.m3u8
for android: http://demo:80/live/livestream.html

step 9: play live stream auto transcoded

rtmp url: rtmp://demo:1935/live/livestream_ld
m3u8 url: http://demo:80/live/livestream_ld.m3u8
for android: http://demo:80/live/livestream_ld.html
rtmp url: rtmp://demo:1935/live/livestream_sd
m3u8 url: http://demo:80/live/livestream_sd.m3u8
for android: http://demo:80/live/livestream_sd.html

step 10: play live stream auto forwarded, the hls dir change to /forward

rtmp url: rtmp://demo:19350/live/livestream
m3u8 url: http://demo:80/forward/live/livestream.m3u8
for android: http://demo:80/forward/live/livestream.html
rtmp url: rtmp://demo:19350/live/livestream_ld
m3u8 url: http://demo:80/forward/live/livestream_ld.m3u8
for android: http://demo:80/forward/live/livestream_ld.html
rtmp url: rtmp://demo:19350/live/livestream_sd
m3u8 url: http://demo:80/forward/live/livestream_sd.m3u8
for android: http://demo:80/forward/live/livestream_sd.html

Architecture

System Architecture:

+------------------------------------------------------+
|             SRS(Simple Rtmp Server)                  |
+---------------+---------------+-----------+----------+
|   API/hook    |   Transcoder  |