/
full.conf
2304 lines (2221 loc) · 91.2 KB
/
full.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
72
73
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# all config for srs
#############################################################################################
# RTMP sections
#############################################################################################
# the pid file
# to ensure only one process can use a pid file
# and provides the current running process id, for script,
# for example, init.d script to manage the server.
# default: ./objs/srs.pid
pid ./objs/srs.pid;
# the default chunk size is 128, max is 65536,
# some client does not support chunk size change,
# however, most clients support it and it can improve
# performance about 10%.
# default: 60000
chunk_size 60000;
# the log dir for FFMPEG.
# if enabled ffmpeg, each transcoding stream will create a log file.
# /dev/null to disable the log.
# default: ./objs
ff_log_dir ./objs;
# the log level for FFMPEG.
# info warning error fatal panic quiet
# trace debug verbose
# default: info
ff_log_level info;
# the log tank, console or file.
# if console, print log to console.
# if file, write log to file. requires srs_log_file if log to file.
# default: file.
srs_log_tank file;
# the log level, for all log tanks.
# can be: verbose, info, trace, warn, error
# default: trace
srs_log_level trace;
# when srs_log_tank is file, specifies the log file.
# default: ./objs/srs.log
srs_log_file ./objs/srs.log;
# The interval in ms, to flush async log. Generally, we flush from
# coroutine-queue to thread-queue, then from thread-queue to disk.
# So the delay of logs might be 2*srs_log_flush_interval.
# Default: 1300
srs_log_flush_interval 1300;
# whether start as daemon
# @remark: do not support reload.
# default: on
daemon on;
# whether use utc_time to generate the time struct,
# if off, use localtime() to generate it,
# if on, use gmtime() instead, which use UTC time.
# default: off
utc_time off;
# config for the pithy print in ms,
# which always print constant message specified by interval,
# whatever the clients in concurrency.
# default: 10000
pithy_print_ms 10000;
# the work dir for server, to chdir(work_dir) when not empty or "./"
# user can config this directory to change the dir.
# @reamrk do not support reload.
# default: ./
work_dir ./;
# whether quit when parent process changed,
# used for supervisor mode(not daemon), srs should always quit when
# supervisor process exited.
# @remark conflict with daemon, error when both daemon and asprocess are on.
# @reamrk do not support reload.
# default: off
asprocess off;
# Whether client empty IP is ok, for example, health checking by SLB.
# If ok(on), we will ignore this connection without warnings or errors.
# default: on
empty_ip_ok on;
# For gracefully quit, wait for a while then close listeners,
# because K8S notify SRS with SIGQUIT and update Service simultaneously,
# maybe there is some new connections incoming before Service updated.
# @see https://github.com/ossrs/srs/issues/1595#issuecomment-587516567
# default: 2300
grace_start_wait 2300;
# For gracefully quit, final wait for cleanup in milliseconds.
# @see https://github.com/ossrs/srs/issues/1579#issuecomment-587414898
# default: 3200
grace_final_wait 3200;
# Whether force gracefully quit, never fast quit.
# By default, SIGTERM which means fast quit, is sent by K8S, so we need to
# force SRS to treat SIGTERM as gracefully quit for gray release or canary.
# @see https://github.com/ossrs/srs/issues/1579#issuecomment-587475077
# default: off
force_grace_quit off;
# Whether disable daemon for docker.
# If on, it will set daemon to off in docker, even daemon is on.
# default: on
disable_daemon_for_docker on;
# Whether auto reload by watching the config file by inotify.
# default: off
inotify_auto_reload off;
# Whether enable inotify_auto_reload for docker.
# If on, it will set inotify_auto_reload to on in docker, even it's off.
# default: on
auto_reload_for_docker on;
# For tcmalloc, the release rate.
# @see https://gperftools.github.io/gperftools/tcmalloc.html
# @remark Should run configure --with-gperf
# default: 0.8
tcmalloc_release_rate 0.8;
# For thread pool.
threads {
# The thread pool manager cycle interval, in seconds.
# Default: 5
interval 5;
# The number of threads for SRTP, codec in dedicate threads.
# Note that 0 to disable it. Max to 64 threads.
# Default: 1
async_srtp 1;
# The number of threads for RECV, recv udp packets in dedicate threads.
# Note that 0 to disable it. Max to 64 threads.
# Default: 1
async_recv 1;
# The number of threads for SEND, send udp packets in dedicate threads.
# Note that 0 to disable it. Max to 64 threads.
# Default: 1
async_send 1;
# Whether enable the tunnel, to consume packets between srtp/recv/send threads,
# without proxy by hybrid(except the few head packets).
# Default: off
async_tunnel off;
# The number of hybrid threads to use, MUST >=1.
# Note that there MUST be same number of stream sections.
# Default: 1
hybrids 1;
# CPU set for affinity, for example:
# 0 means CPU0
# 0-3 means CPU0, CPU1, CPU2
# 1-63 means all CPUs except CPU0
# Default: 0-63
cpu_affinity {
# For master thread manager.
master 0-63;
# For hybrid server or services.
hybrid 0-63;
# For log writing thread.
log 0-63;
# For SRTP encrypt/decrypt thread.
srtp 0-63;
# For UDP recv thread.
recv 0-63;
}
}
# For system circuit breaker.
circuit_breaker {
# If exceed the max size of recv queue, slow the recv to decrease packets.
# Default: 5000
max_recv_queue 5000;
# The CPU percent(0, 100) ever 1s, as system high water-level, which enable the circuit-break
# mechanism, for example, NACK will be disabled if high water-level.
# Default: 90
high_threshold 90;
# Reset the high water-level, if number of pulse under high_threshold.
# @remark 0 to disable the high water-level.
# Default: 2
high_pulse 2;
# The CPU percent(0, 100) ever 1s, as system critical water-level, which enable the circuit-break
# mechanism, for example, TWCC will be disabled if high water-level.
# @note All circuit-break mechanism of high-water-level scope are enabled in critical.
# Default: 95
critical_threshold 95;
# Reset the critical water-level, if number of pulse under critical_threshold.
# @remark 0 to disable the critical water-level.
# Default: 1
critical_pulse 1;
# If dying, also drop packets for players.
# Default: 99
dying_threshold 99;
# If CPU exceed the dying_pulse times, enter dying.
# @remark 0 to disable the dying water-level.
# Default: 5
dying_pulse 5;
}
#############################################################################################
# heartbeat/stats sections
#############################################################################################
# heartbeat to api server
# @remark, the ip report to server, is retrieve from system stat,
# which need the config item stats.network.
heartbeat {
# whether heartbeat is enabled.
# default: off
enabled off;
# the interval seconds for heartbeat,
# recommend 0.3,0.6,0.9,1.2,1.5,1.8,2.1,2.4,2.7,3,...,6,9,12,....
# default: 9.9
interval 9.3;
# when startup, srs will heartbeat to this api.
# @remark: must be a restful http api url, where SRS will POST with following data:
# {
# "device_id": "my-srs-device",
# "ip": "192.168.1.100"
# }
# default: http://127.0.0.1:8085/api/v1/servers
url http://127.0.0.1:8085/api/v1/servers;
# the id of device.
device_id "my-srs-device";
# whether report with summaries
# if on, put /api/v1/summaries to the request data:
# {
# "summaries": summaries object.
# }
# @remark: optional config.
# default: off
summaries off;
}
# system statistics section.
# the main cycle will retrieve the system stat,
# for example, the cpu/mem/network/disk-io data,
# the http api, for instance, /api/v1/summaries will show these data.
# @remark the heartbeat depends on the network,
# for example, the eth0 maybe the device which index is 0.
stats {
# Whether enable the stat of system resources.
# Default: on
enabled on;
# the index of device ip.
# we may retrieve more than one network device.
# default: 0
network 0;
# the device name to stat the disk iops.
# ignore the device of /proc/diskstats if not configured.
disk sda sdb xvda xvdb;
}
#############################################################################################
# HTTP sections
#############################################################################################
# api of srs.
# the http api config, export for external program to manage srs.
# user can access http api of srs in browser directly, for instance, to access by:
# curl http://192.168.1.170:1985/api/v1/reload
# which will reload srs, like cmd killall -1 srs, but the js can also invoke the http api,
# where the cli can only be used in shell/terminate.
http_api {
# whether http api is enabled.
# default: off
enabled on;
# the http api listen entry is <[ip:]port>
# for example, 192.168.1.100:1985
# where the ip is optional, default to 0.0.0.0, that is 1985 equals to 0.0.0.0:1985
# default: 1985
listen 1985;
# whether enable crossdomain request.
# default: on
crossdomain on;
# the HTTP RAW API is more powerful api to change srs state and reload.
raw_api {
# whether enable the HTTP RAW API.
# default: off
enabled off;
# whether enable rpc reload.
# default: off
allow_reload off;
# whether enable rpc query.
# default: off
allow_query off;
# whether enable rpc update.
# default: off
allow_update off;
}
# For https_api or HTTPS API.
https {
# Whether enable HTTPS API.
# default: off
enabled on;
# The listen endpoint for HTTPS API.
# default: 1990
listen 1990;
# The SSL private key file, generated by:
# openssl genrsa -out server.key 2048
# default: ./conf/server.key
key ./conf/server.key;
# The SSL public cert file, generated by:
# openssl req -new -x509 -key server.key -out server.crt -days 3650 -subj "/C=CN/ST=Beijing/L=Beijing/O=Me/OU=Me/CN=ossrs.net"
# default: ./conf/server.crt
cert ./conf/server.crt;
}
}
#############################################################################################
# RTMP/HTTP/RTC Stream sections
#############################################################################################
stream {
# the rtmp listen ports, split by space, each listen entry is <[ip:]port>
# for example, 192.168.1.100:1935 10.10.10.100:1935
# where the ip is optional, default to 0.0.0.0, that is 1935 equals to 0.0.0.0:1935
listen 1935;
# the max connections.
# if exceed the max connections, server will drop the new connection.
# default: 1000
max_connections 1000;
# embedded http server in srs.
# the http streaming config, for HLS/HDS/DASH/HTTPProgressive
# global config for http streaming, user must config the http section for each vhost.
# the embed http server used to substitute nginx in ./objs/nginx,
# for example, srs running in arm, can provides RTMP and HTTP service, only with srs installed.
# user can access the http server pages, generally:
# curl http://192.168.1.170:80/srs.html
# which will show srs version and welcome to srs.
# @remark, the http embedded stream need to config the vhost, for instance, the __defaultVhost__
# need to open the feature http of vhost.
http_server {
# whether http streaming service is enabled.
# default: off
enabled on;
# the http streaming listen entry is <[ip:]port>
# for example, 192.168.1.100:8080
# where the ip is optional, default to 0.0.0.0, that is 8080 equals to 0.0.0.0:8080
# @remark, if use lower port, for instance 80, user must start srs by root.
# default: 8080
listen 8080;
# the default dir for http root.
# default: ./objs/nginx/html
dir ./objs/nginx/html;
# whether enable crossdomain request.
# for both http static and stream server and apply on all vhosts.
# default: on
crossdomain on;
# For https_server or HTTPS Streaming.
https {
# Whether enable HTTPS Streaming.
# default: off
enabled on;
# The listen endpoint for HTTPS Streaming.
# default: 8088
listen 8088;
# The SSL private key file, generated by:
# openssl genrsa -out server.key 2048
# default: ./conf/server.key
key ./conf/server.key;
# The SSL public cert file, generated by:
# openssl req -new -x509 -key server.key -out server.crt -days 3650 -subj "/C=CN/ST=Beijing/L=Beijing/O=Me/OU=Me/CN=ossrs.net"
# default: ./conf/server.crt
cert ./conf/server.crt;
}
}
rtc_server {
# Whether enable WebRTC server.
# default: off
enabled on;
# The udp listen port, we will reuse it for connections.
# default: 8000
listen 8000;
# The exposed candidate IPs, response in SDP candidate line. It can be:
# * Retrieve server IP automatically, from all network interfaces.
# eth0 Retrieve server IP by specified network interface name. # TODO: Implements it.
# $CANDIDATE Read the IP from ENV variable, use * if not set, see https://github.com/ossrs/srs/issues/307#issuecomment-599028124
# x.x.x.x A specified IP address or DNS name, which can be access by client such as Chrome.
# You can specific more than one interface name:
# eth0 eth1 Use network interface eth0 and eth1. # TODO: Implements it.
# Also by IP or DNS names:
# 192.168.1.3 10.1.2.3 rtc.me # TODO: Implements it.
# And by multiple ENV variables:
# $CANDIDATE $EIP # TODO: Implements it.
# @remark For Firefox, the candidate MUST be IP, MUST NOT be DNS name, see also https://github.com/ossrs/srs/pull/1998#issuecomment-726442999
# default: *
candidate *;
# The IP family filter for candidate, it can be:
# ipv4 Filter IP v4 candidates.
# ipv6 Filter IP v6 candidates.
# all Filter all IP v4 or v6 candidates.
# For example, if set to ipv4, we only use the IPv4 address as candidate.
# default: ipv4
ip_family ipv4;
# Whether use ECDSA certificate.
# If not, use RSA certificate.
# default: on
ecdsa on;
# Whether encrypt RTP packet by SRTP.
# @remark Should always turn it on, or Chrome will fail.
# default: on
encrypt on;
# We listen multiple times at the same port, by REUSEPORT, to increase the UDP queue.
# Note that you can set to 1 and increase the system UDP buffer size by net.core.rmem_max
# and net.core.rmem_default or just increase this to get larger UDP recv and send buffer.
# default: 1
reuseport 1;
# Whether merge multiple NALUs into one.
# @see https://github.com/ossrs/srs/issues/307#issuecomment-612806318
# default: off
merge_nalus off;
# Whether enable the perf stat at http://localhost:1985/api/v1/perf
# TODO: FIXME: We should enable it when refined.
# default: off
perf_stat off;
# For RTP packet and its payload cache.
rtp_cache {
# Whether enable the RTP packet cache.
# default: on
enabled on;
# The cache size for rtp packet in MB, each object is about 300B..
# default: 64
pkt_size 64.0;
# The cache size for rtp payload in MB, each object is about 40B.
# default: 16
payload_size 16.0;
}
# For RTP shared message and the large buffer cache.
rtp_msg_cache {
#Whether enable the RTP message(a large buffer) cache.
# default: on
enabled on;
# The cache size for message object in MB, each object is about 40B.
# default: 16
msg_size 16.0;
# The cache size for message large buffer in MB, each object is about 1500B.
# default: 512
buffer_size 512.0;
}
# The black-hole to copy packet to, for debugging.
# For example, when debugging Chrome publish stream, the received packets are encrypted cipher,
# we can set the publisher black-hole, SRS will copy the plaintext packets to black-hole, and
# we are able to capture the plaintext packets by wireshark.
black_hole {
# Whether enable the black-hole.
# default: off
enabled off;
# The black-hole address for session.
addr 127.0.0.1:10000;
}
}
}
vhost rtc.vhost.srs.com {
rtc {
# Whether enable WebRTC server.
# default: off
enabled on;
# The strategy for bframe.
# keep Keep bframe, which may make browser with playing problems.
# discard Discard bframe, maybe cause browser with little problems.
# default: keep
bframe discard;
# The strategy for aac audio.
# transcode Transcode aac to opus.
# discard Discard aac audio packet.
# default: transcode
aac transcode;
# The timeout in seconds for session timeout.
# Client will send ping(STUN binding request) to server, we use it as heartbeat.
# default: 30
stun_timeout 30;
# The strick check when process stun.
# default: off
stun_strict_check on;
# The role of dtls when peer is actpass: passive or active
# default: passive
dtls_role passive;
# The version of dtls, support dtls1.0, dtls1.2, and auto
# default: auto
dtls_version auto;
# Drop the packet with the pt(payload type), 0 never drop.
# default: 0
drop_for_pt 0;
}
# whether enable min delay mode for vhost.
# default: on, for RTC.
min_latency on;
play {
# set the MW(merged-write) latency in ms.
# @remark For WebRTC, we enable pass-timestamp mode, so we ignore this config.
# default: 0 (For WebRTC)
mw_latency 0;
# Set the MW(merged-write) min messages.
# default: 0 (For Real-Time, min_latency on)
# default: 1 (For WebRTC, min_latency off)
mw_msgs 0;
}
# For NACK.
nack {
# Whether support NACK.
# default: on
enabled on;
# Whether directly use the packet, avoid copy.
# default: on
no_copy on;
}
# For TWCC.
twcc {
# Whether support TWCC.
# default: on
enabled on;
}
}
#############################################################################################
# Streamer sections
#############################################################################################
# the streamer cast stream from other protocol to SRS over RTMP.
# @see https://github.com/ossrs/srs/tree/develop#stream-architecture
# MPEGTS over UDP
stream_caster {
# whether stream caster is enabled.
# default: off
enabled on;
# the caster type of stream, the casters:
# mpegts_over_udp, MPEG-TS over UDP caster.
caster mpegts_over_udp;
# the output rtmp url.
# for mpegts_over_udp caster, the typically output url:
# rtmp://127.0.0.1/live/livestream
output rtmp://127.0.0.1/live/livestream;
# the listen port for stream caster.
# for mpegts_over_udp caster, listen at udp port. for example, 8935.
listen 8935;
}
# RTSP
# It's deprecated and will be removed in the future, see [#2304](https://github.com/ossrs/srs/issues/2304#issuecomment-826009290).
stream_caster {
# whether stream caster is enabled.
# default: off
enabled on;
# the caster type of stream, the casters:
# rtsp, Real Time Streaming Protocol (RTSP).
caster rtsp;
# the output rtmp url.
# for rtsp caster, the typically output url:
# rtmp://127.0.0.1/[app]/[stream]
# for example, the rtsp url:
# rtsp://192.168.1.173:8544/live/livestream.sdp
# where the [app] is "live" and [stream] is "livestream", output is:
# rtmp://127.0.0.1/live/livestream
output rtmp://127.0.0.1/[app]/[stream];
# the listen port for stream caster.
# for rtsp caster, listen at tcp port. for example, 554.
listen 554;
# for the rtsp caster, the rtp server local port over udp,
# which reply the rtsp setup request message, the port will be used:
# [rtp_port_min, rtp_port_max)
rtp_port_min 57200;
rtp_port_max 57300;
}
# FLV
stream_caster {
# whether stream caster is enabled.
# default: off
enabled on;
# the caster type of stream, the casters:
# flv, FLV over HTTP by POST.
caster flv;
# the output rtmp url.
# for flv caster, the typically output url:
# rtmp://127.0.0.1/[app]/[stream]
# for example, POST to url:
# http://127.0.0.1:8936/live/livestream.flv
# where the [app] is "live" and [stream] is "livestream", output is:
# rtmp://127.0.0.1/live/livestream
output rtmp://127.0.0.1/[app]/[stream];
# the listen port for stream caster.
# for flv caster, listen at tcp port. for example, 8936.
listen 8936;
}
# GB28181
stream_caster {
# whether stream caster is enabled.
# default: off
enabled on;
# the caster type of stream, the casters:
# gb28181, Push GB28181 to SRS.
caster gb28181;
# the output rtmp url.
# for gb28181 caster, the typically output url:
# rtmp://127.0.0.1/live/[stream]
# where the [stream] is the VideoChannelCodecID.
output rtmp://127.0.0.1/live/[stream];
# the listen port for stream caster.
# for gb28181 caster, listen at udp port. for example, 9000.
# @remark We can bundle all gb28181 to this port, to reuse this port.
# User can choose to bundle port in API port_mode or SIP invite_port_fixed.
listen 9000;
# Listen as TCP if on; otherwise, listen as UDP.
# default: off
tcp_enable off;
# If not bundle ports, use specified ports for each stream.
rtp_port_min 58200;
rtp_port_max 58300;
# Whether wait for keyframe then forward to RTMP.
# default: on
wait_keyframe on;
# Max timeout in seconds for RTP stream, if timeout, RTCP bye and close stream.
# default: 30
rtp_idle_timeout 30;
# Whether has audio.
# @remark Flash/RTMP only supports 11025 22050 44100 sample rate, if not the audio may corrupt.
# default: off
audio_enable off;
# The exposed IP to receive media stream.
# * Retrieve server IP automatically, from all network interfaces.
# eth0 Retrieve server IP by specified network interface name. # TODO: Implements it.
# $CANDIDATE Read the IP from ENV variable $EIP, use * if not set, see https://github.com/ossrs/srs/issues/307#issuecomment-599028124
# x.x.x.x A specified IP address or DNS name, which can be access by client such as Chrome.
# You can specific more than one interface name:
# eth0 eth1 Use network interface eth0 and eth1. # TODO: Implements it.
# Also by IP or DNS names:
# 192.168.1.3 10.1.2.3 rtc.me # TODO: Implements it.
# And by multiple ENV variables:
# $CANDIDATE $EIP # TODO: Implements it.
# default: *
host *;
#The media channel is automatically created according to the received RTP packet,
# and the channel ID is generated according to the RTP SSRC
# channelid format: 'chid[ssrc]' [ssrc] is rtp's ssrc
auto_create_channel off;
sip {
# Whether enable embeded SIP server.
# default: on
enabled on;
# The SIP listen port.
# default: 5060
listen 5060;
# The SIP server ID.
# default: 34020000002000000001
serial 34020000002000000001;
# The SIP server domain.
# default: 3402000000
realm 3402000000;
# The SIP ACK response timeout in seconds.
# default: 30
ack_timeout 30;
# The keepalive timeout in seconds.
# default: 120
keepalive_timeout 120;
# Whether play immediately after registered.
# default: on
auto_play on;
# Whether bundle media stream port.
# default: on
invite_port_fixed on;
# interval to query equipment list from equipment or subordinate domain, unit(s)
# default: 60
query_catalog_interval 60;
}
}
#############################################################################################
# SRT server section
#############################################################################################
# @doc https://github.com/ossrs/srs/issues/1147#issuecomment-577607026
srt_server {
# whether SRT server is enabled.
# default: off
enabled on;
# The UDP listen port for SRT.
listen 10080;
# For detail parameters, please read wiki:
# https://github.com/ossrs/srs/wiki/v4_CN_SRTParams
# https://github.com/ossrs/srs/wiki/v4_EN_SRTParams
maxbw 1000000000;
connect_timeout 4000;
peerlatency 300;
recvlatency 300;
# Default app for vmix, see https://github.com/ossrs/srs/pull/1615
# default: live
default_app live;
}
#############################################################################################
# RTMP/HTTP VHOST sections
#############################################################################################
# vhost list, the __defaultVhost__ is the default vhost
# for example, user use ip to access the stream: rtmp://192.168.1.2/live/livestream.
# for which cannot identify the required vhost.
vhost __defaultVhost__ {
}
# the vhost scope configs.
vhost scope.vhost.srs.com {
# whether the vhost is enabled.
# if off, all request access denied.
# default: on
enabled off;
# whether enable min delay mode for vhost.
# for min latency mode:
# 1. disable the publish.mr for vhost.
# 2. use timeout for cond wait for consumer queue.
# @see https://github.com/ossrs/srs/issues/257
# default: off (for RTMP/HTTP-FLV)
# default: on (for WebRTC)
min_latency off;
# whether enable the TCP_NODELAY
# if on, set the nodelay of fd by setsockopt
# default: off
tcp_nodelay off;
# the default chunk size is 128, max is 65536,
# some client does not support chunk size change,
# vhost chunk size will override the global value.
# default: global chunk size.
chunk_size 128;
# The input ack size, 0 to not set.
# Generally, it's set by the message from peer,
# but for some peer(encoder), it never send message but use a different ack size.
# We can chnage the default ack size in server-side, to send acknowledge message,
# or the encoder maybe blocked after publishing for some time.
# Default: 0
in_ack_size 0;
# The output ack size, 0 to not set.
# This is used to notify the peer(player) to send acknowledge to server.
# Default: 2500000
out_ack_size 2500000;
}
# set the chunk size of vhost.
vhost chunksize.srs.com {
# @see scope.vhost.srs.com
chunk_size 128;
}
# the vhost disabled.
vhost removed.srs.com {
# @see scope.vhost.srs.com
enabled off;
}
# vhost for stream cluster for RTMP/FLV
vhost cluster.srs.com {
# The config for cluster.
cluster {
# The cluster mode, local or remote.
# local: It's an origin server, serve streams itself.
# remote: It's an edge server, fetch or push stream to origin server.
# default: local
mode remote;
# For edge(mode remote), user must specifies the origin server
# format as: <server_name|ip>[:port]
# @remark user can specifies multiple origin for error backup, by space,
# for example, 192.168.1.100:1935 192.168.1.101:1935 192.168.1.102:1935
origin 127.0.0.1:1935 localhost:1935;
# For edge(mode remote), whether open the token traverse mode,
# if token traverse on, all connections of edge will forward to origin to check(auth),
# it's very important for the edge to do the token auth.
# the better way is use http callback to do the token auth by the edge,
# but if user prefer origin check(auth), the token_traverse if better solution.
# default: off
token_traverse off;
# For edge(mode remote), the vhost to transform for edge,
# to fetch from the specified vhost at origin,
# if not specified, use the current vhost of edge in origin, the variable [vhost].
# default: [vhost]
vhost same.edge.srs.com;
# For edge(mode remote), when upnode(forward to, edge push to, edge pull from) is srs,
# it's strongly recommend to open the debug_srs_upnode,
# when connect to upnode, it will take the debug info,
# for example, the id, source id, pid.
# please see: https://github.com/ossrs/srs/wiki/v1_CN_SrsLog
# default: on
debug_srs_upnode on;
# For origin(mode local) cluster, turn on the cluster.
# @remark Origin cluster only supports RTMP, use Edge to transmux RTMP to FLV.
# default: off
# TODO: FIXME: Support reload.
origin_cluster off;
# For origin (mode local) cluster, the co-worker's HTTP APIs.
# This origin will connect to co-workers and communicate with them.
# please read: https://github.com/ossrs/srs/wiki/v3_EN_OriginCluster
# TODO: FIXME: Support reload.
coworkers 127.0.0.1:9091 127.0.0.1:9092;
# The protocol to connect to origin.
# rtmp, Connect origin by RTMP
# flv, Connect origin by HTTP-FLV
# flvs, Connect origin by HTTPS-FLV
# Default: rtmp
protocol rtmp;
# Whether follow client protocol to connect to origin.
# @remark The FLV might use different signature(in query string) to RTMP.
# Default: off
follow_client off;
}
}
# vhost for edge, edge and origin is the same vhost
vhost same.edge.srs.com {
# @see cluster.srs.com
cluster {
mode remote;
origin 127.0.0.1:1935 localhost:1935;
token_traverse off;
}
}
# vhost for edge, edge transform vhost to fetch from another vhost.
vhost transform.edge.srs.com {
# @see cluster.srs.com
cluster {
mode remote;
origin 127.0.0.1:1935;
vhost same.edge.srs.com;
}
}
# the vhost for srs debug info, whether send args in connect(tcUrl).
vhost debug.srs.com {
# @see cluster.srs.com
cluster {
debug_srs_upnode on;
}
}
# the vhost which forward publish streams.
vhost same.vhost.forward.srs.com {
# forward stream to other servers.
forward {
# whether enable the forward.
# default: off
enabled on;
# forward all publish stream to the specified server.
# this used to split/forward the current stream for cluster active-standby,
# active-active for cdn to build high available fault tolerance system.
# format: {ip}:{port} {ip_N}:{port_N}
destination 127.0.0.1:1936 127.0.0.1:1937;
}
}
# the play specified configs
vhost play.srs.com {
# for play client, both RTMP and other stream clients,
# for instance, the HTTP FLV stream clients.
play {
# whether cache the last gop.
# if on, cache the last gop and dispatch to client,
# to enabled fast startup for client, client play immediately.
# if off, send the latest media data to client,
# client need to wait for the next Iframe to decode and show the video.
# set to off if requires min delay;
# set to on if requires client fast startup.
# default: on
gop_cache off;
# the max live queue length in seconds.
# if the messages in the queue exceed the max length,
# drop the old whole gop.
# default: 30
queue_length 10;
# about the stream monotonically increasing:
# 1. video timestamp is monotonically increasing,
# 2. audio timestamp is monotonically increasing,
# 3. video and audio timestamp is interleaved/mixed monotonically increasing.
# it's specified by RTMP specification, @see 3. Byte Order, Alignment, and Time Format
# however, some encoder cannot provides this feature, please set this to off to ignore time jitter.
# the time jitter algorithm:
# 1. full, to ensure stream start at zero, and ensure stream monotonically increasing.
# 2. zero, only ensure stream start at zero, ignore timestamp jitter.
# 3. off, disable the time jitter algorithm, like atc.
# @remark for full, correct timestamp only when |delta| > 250ms.
# @remark disabled when atc is on.
# default: full
time_jitter full;
# vhost for atc for hls/hds/rtmp backup.
# generally, atc default to off, server delivery rtmp stream to client(flash) timestamp from 0.
# when atc is on, server delivery rtmp stream by absolute time.
# atc is used, for instance, encoder will copy stream to master and slave server,
# server use atc to delivery stream to edge/client, where stream time from master/slave server
# is always the same, client/tools can slice RTMP stream to HLS according to the same time,
# if the time not the same, the HLS stream cannot slice to support system backup.
#
# @see http://www.adobe.com/cn/devnet/adobe-media-server/articles/varnish-sample-for-failover.html
# @see http://www.baidu.com/#wd=hds%20hls%20atc
#
# @remark when atc is on, auto off the time_jitter
# default: off
atc off;
# whether use the interleaved/mixed algorithm to correct the timestamp.
# if on, always ensure the timestamp of audio+video is interleaved/mixed monotonically increase.
# if off, use time_jitter to correct the timestamp if required.
# @remark to use mix_correct, atc should on(or time_jitter should off).
# default: off
mix_correct off;
# whether enable the auto atc,
# if enabled, detect the bravo_atc="true" in onMetaData packet,
# set atc to on if matched.
# always ignore the onMetaData if atc_auto is off.
# default: off
atc_auto off;
# set the MW(merged-write) latency in ms.
# SRS always set mw on, so we just set the latency value.
# the latency of stream >= mw_latency + mr_latency
# the value recomment is [300, 1800]
# @remark For WebRTC, we enable pass-timestamp mode, so we ignore this config.
# default: 350 (For RTMP/HTTP-FLV)
# default: 0 (For WebRTC)
mw_latency 350;
# Set the MW(merged-write) min messages.
# default: 0 (For Real-Time, min_latency on)
# default: 1 (For WebRTC, min_latency off)
# default: 8 (For RTMP/HTTP-FLV, min_latency off).
mw_msgs 8;
# the minimal packets send interval in ms,
# used to control the ndiff of stream by srs_rtmp_dump,
# for example, some device can only accept some stream which
# delivery packets in constant interval(not cbr).
# @remark 0 to disable the minimal interval.
# @remark >0 to make the srs to send message one by one.
# @remark user can get the right packets interval in ms by srs_rtmp_dump.
# default: 0
send_min_interval 10.0;
# whether reduce the sequence header,
# for some client which cannot got duplicated sequence header,
# while the sequence header is not changed yet.
# default: off
reduce_sequence_header on;
}
}
# vhost for time jitter
vhost jitter.srs.com {
# @see play.srs.com
# to use time_jitter full, the default config.
play {
}
# to use mix_correct.
play {
time_jitter off;
mix_correct on;
}
play {
atc on;
mix_correct on;
}
# to use atc
play {
atc on;
}
}
# vhost for atc.
vhost atc.srs.com {
# @see play.srs.com
play {
atc on;
atc_auto on;
}
}
# the MR(merged-read) setting for publisher.
# the MW(merged-write) settings for player.
vhost mrw.srs.com {
# @see scope.vhost.srs.com
min_latency off;
# @see play.srs.com
play {
mw_latency 350;
mw_msgs 8;
}
# @see publish.srs.com
publish {
mr on;
mr_latency 350;
}
}
# the vhost for min delay, do not cache any stream.
vhost min.delay.com {
# @see scope.vhost.srs.com
min_latency on;
# @see scope.vhost.srs.com
tcp_nodelay on;
# @see play.srs.com
play {
mw_latency 100;
mw_msgs 4;