mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
SquashSRS4: Support RTC2RTMP.
This commit is contained in:
parent
0b62216999
commit
74bb47c13f
22 changed files with 1246 additions and 844 deletions
|
@ -446,14 +446,14 @@ srt_server {
|
|||
rtc_server {
|
||||
# Whether enable WebRTC server.
|
||||
# default: off
|
||||
enabled on;
|
||||
enabled on;
|
||||
# The udp listen port, we will reuse it for connections.
|
||||
# default: 8000
|
||||
listen 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
|
||||
# $CANDIDATE Read the IP from ENV variable, use * if not set.
|
||||
# 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.
|
||||
|
@ -461,37 +461,38 @@ rtc_server {
|
|||
# 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
|
||||
# @remark For Firefox, the candidate MUST be IP, MUST NOT be DNS name.
|
||||
# @see https://github.com/ossrs/srs/wiki/v4_CN_RTCWiki#config-candidate
|
||||
# default: *
|
||||
candidate *;
|
||||
# The IP family filter for candidate, it can be:
|
||||
candidate *;
|
||||
# The IP family filter for auto discover 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;
|
||||
ip_family ipv4;
|
||||
# Whether use ECDSA certificate.
|
||||
# If not, use RSA certificate.
|
||||
# default: on
|
||||
ecdsa on;
|
||||
ecdsa on;
|
||||
# Whether encrypt RTP packet by SRTP.
|
||||
# @remark Should always turn it on, or Chrome will fail.
|
||||
# default: on
|
||||
encrypt 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;
|
||||
reuseport 1;
|
||||
# Whether merge multiple NALUs into one.
|
||||
# @see https://github.com/ossrs/srs/issues/307#issuecomment-612806318
|
||||
# default: off
|
||||
merge_nalus 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;
|
||||
perf_stat off;
|
||||
# For RTP packet and its payload cache.
|
||||
rtp_cache {
|
||||
# Whether enable the RTP packet cache.
|
||||
|
@ -533,61 +534,67 @@ 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;
|
||||
enabled on;
|
||||
# Whether support NACK.
|
||||
# default: on
|
||||
nack on;
|
||||
# Whether directly use the packet, avoid copy.
|
||||
# default: on
|
||||
nack_no_copy on;
|
||||
# Whether support TWCC.
|
||||
# default: on
|
||||
twcc on;
|
||||
# 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.
|
||||
stun_timeout 30;
|
||||
# The strict 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;
|
||||
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;
|
||||
###############################################################
|
||||
# For transmuxing RTMP to RTC, the strategy for bframe.
|
||||
# keep Keep bframe, which may make browser with playing problems.
|
||||
# discard Discard bframe, maybe cause browser with little problems.
|
||||
# default: discard
|
||||
bframe discard;
|
||||
# For transmuxing RTMP to RTC, the strategy for aac audio.
|
||||
# transcode Transcode aac to opus.
|
||||
# discard Discard aac audio packet.
|
||||
# default: transcode
|
||||
aac transcode;
|
||||
###############################################################
|
||||
# For transmuxing RTC to RTMP.
|
||||
# Whether trans-mux RTC to RTMP streaming.
|
||||
# Default: off
|
||||
rtc_to_rtmp off;
|
||||
# The PLI interval in seconds, for RTC to RTMP.
|
||||
# Note the available range is [0.5, 30]
|
||||
# Default: 6.0
|
||||
pli_for_rtmp 6.0;
|
||||
}
|
||||
# whether enable min delay mode for vhost.
|
||||
###############################################################
|
||||
# For transmuxing RTMP to RTC, it will impact the default values if RTC is on.
|
||||
# Whether enable min delay mode for vhost.
|
||||
# default: on, for RTC.
|
||||
min_latency on;
|
||||
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;
|
||||
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;
|
||||
# default: 0 (For Real-Time, that is min_latency on)
|
||||
# default: 1 (For WebRTC, that is min_latency off)
|
||||
mw_msgs 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,21 +18,20 @@ stats {
|
|||
network 0;
|
||||
}
|
||||
rtc_server {
|
||||
enabled on;
|
||||
enabled on;
|
||||
# Listen at udp://8000
|
||||
listen 8000;
|
||||
listen 8000;
|
||||
#
|
||||
# The $CANDIDATE means fetch from env, if not configed, use * as default.
|
||||
#
|
||||
# The * means retrieving server IP automatically, from all network interfaces,
|
||||
# @see https://github.com/ossrs/srs/issues/307#issuecomment-599028124
|
||||
candidate $CANDIDATE;
|
||||
# @see https://github.com/ossrs/srs/wiki/v4_CN_RTCWiki#config-candidate
|
||||
candidate $CANDIDATE;
|
||||
}
|
||||
|
||||
vhost __defaultVhost__ {
|
||||
rtc {
|
||||
enabled on;
|
||||
bframe discard;
|
||||
}
|
||||
http_remux {
|
||||
enabled on;
|
||||
|
|
42
trunk/conf/rtc2rtmp.conf
Normal file
42
trunk/conf/rtc2rtmp.conf
Normal file
|
@ -0,0 +1,42 @@
|
|||
|
||||
listen 1935;
|
||||
max_connections 1000;
|
||||
daemon off;
|
||||
srs_log_tank console;
|
||||
|
||||
http_server {
|
||||
enabled on;
|
||||
listen 8080;
|
||||
dir ./objs/nginx/html;
|
||||
}
|
||||
|
||||
http_api {
|
||||
enabled on;
|
||||
listen 1985;
|
||||
}
|
||||
stats {
|
||||
network 0;
|
||||
}
|
||||
rtc_server {
|
||||
enabled on;
|
||||
# Listen at udp://8000
|
||||
listen 8000;
|
||||
#
|
||||
# The $CANDIDATE means fetch from env, if not configed, use * as default.
|
||||
#
|
||||
# The * means retrieving server IP automatically, from all network interfaces,
|
||||
# @see https://github.com/ossrs/srs/wiki/v4_CN_RTCWiki#config-candidate
|
||||
candidate $CANDIDATE;
|
||||
}
|
||||
|
||||
vhost __defaultVhost__ {
|
||||
rtc {
|
||||
enabled on;
|
||||
rtc_to_rtmp on;
|
||||
}
|
||||
http_remux {
|
||||
enabled on;
|
||||
mount [vhost]/[app]/[stream].flv;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
|
||||
listen 1935;
|
||||
max_connections 1000;
|
||||
daemon off;
|
||||
srs_log_tank console;
|
||||
|
||||
http_server {
|
||||
enabled on;
|
||||
listen 8080;
|
||||
}
|
||||
|
||||
http_api {
|
||||
enabled on;
|
||||
listen 1985;
|
||||
}
|
||||
|
||||
rtc_server {
|
||||
enabled on;
|
||||
listen 8000;
|
||||
candidate $CANDIDATE;
|
||||
}
|
||||
|
||||
vhost __defaultVhost__ {
|
||||
rtc {
|
||||
enabled on;
|
||||
bframe discard;
|
||||
}
|
||||
|
||||
http_remux {
|
||||
enabled on;
|
||||
mount [vhost]/[app]/[stream].flv;
|
||||
}
|
||||
|
||||
tcp_nodelay on
|
||||
min_latency on;
|
||||
|
||||
play {
|
||||
gop_cache off;
|
||||
queue_length 10;
|
||||
mw_latency 100;
|
||||
}
|
||||
|
||||
publish {
|
||||
mr off;
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue