Skip to content

v1_EN_SampleRTMP

winlin edited this page Nov 17, 2014 · 37 revisions

RTMP deploy example

RTMP部署的步骤。

Suppose the server ip is 192.168.1.170

Step 1, get SRS. For detail, read GIT

git clone https://github.com/winlinvip/simple-rtmp-server
cd simple-rtmp-server/trunk

Or update the exists code:

git pull

Step 2, build SRS. For detail, read Build

./configure --disable-all --with-ssl && make

第三步,编写SRS配置文件。 For detail, read RTMP

Save bellow as config, or use conf/rtmp.conf:

# conf/rtmp.conf
listen              1935;
max_connections     1000;
vhost __defaultVhost__ {
}

第三步,启动SRS。 For detail, read RTMP

./objs/srs -c conf/rtmp.conf

第四步,启动推流编码器。 For detail, read RTMP

Use FFMPEG to publish stream:

    for((;;)); do \
        ./objs/ffmpeg/bin/ffmpeg -re -i ./doc/source.200kbps.768x320.flv \
        -vcodec copy -acodec copy \
        -f flv -y rtmp://192.168.1.170/live/livestream; \
        sleep 1; \
    done

Or use FMLE to publish:

FMS URL: rtmp://192.168.1.170/live
Stream: livestream

第五步,观看RTMP流。 For detail, read RTMP

RTMP url is: rtmp://192.168.1.170:1935/live/livestream

User can use vlc to play the RTMP stream.

Or, use online SRS player: http://winlinvip.github.io/srs.release/trunk/research/players/srs_player.html?vhost=defaultVhost&autostart=true&server=192.168.1.170&app=live&stream=livestream&port=1935

Note: Please replace all ip 192.168.1.170 to your server ip.

Winlin 2014.3

Welcome to SRS wiki!

SRS 5.0 wiki

Please select your language:

SRS 4.0 wiki

Please select your language:

SRS 3.0 wiki

Please select your language:

SRS 2.0 wiki

Please select your language:

SRS 1.0 wiki

Please select your language:

Clone this wiki locally