Skip to content

migrate_v4_EN_sample dash

winlin edited this page Jul 31, 2022 · 1 revision

HOME > EN > DASH

DASH deploy example

Delivery DASH by SRS:

Suppose the server ip is 192.168.1.170

Step 1, get SRS. For detail, read GIT

git clone https://github.com/ossrs/srs
cd srs/trunk

Or update the exists code:

git pull

Step 2, build SRS. For detail, read Build

./configure && make

Step 3, config srs. Please read DASH

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

# conf/dash.conf
listen              1935;
max_connections     1000;
daemon              off;
srs_log_tank        console;
http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
}
vhost __defaultVhost__ {
    dash {
        enabled         on;
        dash_fragment       30;
        dash_update_period  150;
        dash_timeshift      300;
        dash_path           ./objs/nginx/html;
        dash_mpd_file       [app]/[stream].mpd;
    }
}

Step 4, start srs.

./objs/srs -c conf/dash.conf

Note: You can also use other web server, such as NGINX, to delivery files of DASH.

Step 5, start encoder.

Use FFMPEG to publish stream:

    for((;;)); do \
        ./objs/ffmpeg/bin/ffmpeg -re -i ./doc/source.flv \
        -c copy \
        -f flv rtmp://192.168.1.170/live/livestream; \
        sleep 1; \
    done

The stream in SRS:

  • RTMP url:rtmp://192.168.1.170/live/livestream
  • DASH url: http://192.168.1.170:8080/live/livestream.mpd

Step 6, play RTMP stream.

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: srs-player

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

Step 7, play DASH stream.

DASH url: http://192.168.1.170:8080/live/livestream.mpd

Please use VLC or dash.js to play.

Winlin 2020.01

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