Blame view

trunk/conf/demo.conf 5.9 KB
winlin authored
1
# the config for srs demo
2
# @see https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_SampleDemo
winlin authored
3 4
# @see full.conf for detail config.
5
listen              1935;
6
max_connections     1000;
7 8
daemon              on;
srs_log_tank        file;
winlin authored
9
srs_log_file        ./objs/srs.demo.log;
10 11
pid                 ./objs/srs.demo.pid;
12 13 14
chunk_size          60000;
max_connections     2000;
winlin authored
15 16 17 18 19 20 21 22 23 24 25
http_api {
    enabled         on;
    listen          1985;
}

http_stream {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
}
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
vhost __defaultVhost__ {
    enabled         on;
    gop_cache       on;
}

vhost bandcheck.srs.com {
    enabled         on;
    chunk_size      65000;
    bandcheck {
        enabled         on;
        key             "35c9b402c12a7246868752e2878f7e0e";
        interval        30;
        limit_kbps      4000;
    }
}

vhost demo.srs.com {
    chunk_size      60000;
    enabled         on;
    gop_cache       on;
    queue_length    30;
    forward         127.0.0.1:19350;
    bandcheck {
        enabled         off;
    }
    hls {
        enabled         on;
        hls_path        ./objs/nginx/html;
        hls_fragment    5;
        hls_window      30;
    }
    http_hooks {
        enabled         on;
        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 {
        enabled         on;
        ffmpeg          ./objs/ffmpeg/bin/ffmpeg;
        engine ld {
            enabled         on;
            vfilter {
72 73
                i               ./doc/srs-logo.png;
                filter_complex      'overlay=10:10';
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
            }
            vcodec          libx264;
            vbitrate        300;
            vfps            20;
            vwidth          768;
            vheight         320;
            vthreads        1;
            vprofile        baseline;
            vpreset         superfast;
            vparams {
            }
            acodec          libaacplus;
            abitrate        45;
            asample_rate    44100;
            achannels       2;
            aparams {
            }
            output          rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
        }
        engine sd {
            enabled         on;
            vfilter {
                vf                  'split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2';
            }
            vcodec          libx264;
            vbitrate        500;
            vfps            20;
            vwidth          768;
            vheight         320;
            vthreads        1;
            vprofile        main;
            vpreset         fast;
            vparams {
            }
            acodec          libaacplus;
            abitrate        40;
            asample_rate    44100;
            achannels       2;
            aparams {
            }
            output          rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
        }
    }
117
    ingest {
winlin authored
118
        enabled      on;
119 120 121 122 123 124
        input {
            type    file;
            url     ./doc/source.200kbps.768x320.flv;
        }
        ffmpeg      ./objs/ffmpeg/bin/ffmpeg;
        engine {
winlin authored
125
            enabled          off;
126 127 128
            output          rtmp://127.0.0.1:[port]/live?vhost=[vhost]/livestream;
        }
    }
129 130 131 132 133 134 135 136 137 138 139
}

vhost players {
    enabled         on;
    gop_cache       on;
    transcode {
        enabled         on;
        ffmpeg          ./objs/ffmpeg/bin/ffmpeg;
        engine hls {
            enabled         on;
            vfilter {
140 141
                i               ./doc/srs-logo.png;
                filter_complex      'overlay=10:10';
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
            }
            vcodec          libx264;
            vbitrate        300;
            vfps            20;
            vwidth          768;
            vheight         320;
            vthreads        1;
            vprofile        baseline;
            vpreset         superfast;
            vparams {
                g           100;
            }
            acodec          libaacplus;
            abitrate        30;
            asample_rate    44100;
            achannels       2;
            aparams {
            }
            output          rtmp://127.0.0.1:[port]/[app]?vhost=players_pub/[stream];
        }
    }
163
    ingest {
winlin authored
164
        enabled      on;
165 166 167 168 169 170
        input {
            type    file;
            url     ./doc/source.200kbps.768x320.flv;
        }
        ffmpeg      ./objs/ffmpeg/bin/ffmpeg;
        engine {
winlin authored
171
            enabled          off;
172 173 174
            output          rtmp://127.0.0.1:[port]/live?vhost=[vhost]/demo;
        }
    }
175 176 177 178 179 180 181 182 183 184
}
vhost players_pub {
    hls {
        enabled         on;
        hls_path        ./objs/nginx/html;
        hls_fragment    5;
        hls_window      30;
    }
}
winlin authored
185
vhost players_chat {
186 187 188 189
    gop_cache       off;
    hls {
        enabled         off;
    }
winlin authored
190 191 192 193 194
    transcode {
        enabled         on;
        ffmpeg          ./objs/ffmpeg/bin/ffmpeg;
        engine chat_hls {
            enabled         on;
winlin authored
195 196 197
            vfilter {
            }
            vcodec          libx264;
198
            vbitrate        150;
winlin authored
199
            vfps            15;
200 201
            vwidth          576;
            vheight         240;
winlin authored
202 203
            vthreads        1;
            vprofile        baseline;
204
            vpreset         ultrafast;
winlin authored
205 206 207
            vparams {
                g           30;
            }
winlin authored
208
            acodec          an;
winlin authored
209
            output          rtmp://127.0.0.1:[port]/[app]?vhost=chat_hls/[stream];
winlin authored
210 211 212 213 214 215 216 217
        }
    }
}
vhost chat_hls {
    hls {
        enabled         on;
        hls_path        ./objs/nginx/html;
        hls_fragment    2;
winlin authored
218
        hls_window      10;
winlin authored
219
    }
220
}