1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Refine for writing doc. 4.0.92

This commit is contained in:
winlin 2021-05-01 16:41:42 +08:00
parent f4f616d4e9
commit 659e173e15
7 changed files with 67 additions and 84 deletions

View file

@ -22,7 +22,7 @@ docker run --rm -p 1935:1935 -p 1985:1985 -p 8080:8080 \
ossrs/srs:v4.0.85 ossrs/srs:v4.0.85
``` ```
> To enable WebRTC, user MUST set the env `CANDIDATE`, see [#307](https://github.com/ossrs/srs/issues/307#issue-76908382). > To enable WebRTC, user MUST set the env `CANDIDATE`, see [wiki](https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#config-candidate).
Open [http://localhost:8080/](http://localhost:8080/) to check it, then publish Open [http://localhost:8080/](http://localhost:8080/) to check it, then publish
[stream](https://github.com/ossrs/srs/blob/3.0release/trunk/doc/source.flv) by: [stream](https://github.com/ossrs/srs/blob/3.0release/trunk/doc/source.flv) by:
@ -67,8 +67,7 @@ Fast index for Wikis:
* How to deliver HTTP-FLV streaming?([CN][v4_CN_SampleHttpFlv], [EN][v4_EN_SampleHttpFlv]) * How to deliver HTTP-FLV streaming?([CN][v4_CN_SampleHttpFlv], [EN][v4_EN_SampleHttpFlv])
* How to deliver HLS streaming?([CN][v4_CN_SampleHLS], [EN][v4_EN_SampleHLS]) * How to deliver HLS streaming?([CN][v4_CN_SampleHLS], [EN][v4_EN_SampleHLS])
* How to deliver low-latency streaming?([CN][v4_CN_SampleRealtime], [EN][v4_EN_SampleRealtime]) * How to deliver low-latency streaming?([CN][v4_CN_SampleRealtime], [EN][v4_EN_SampleRealtime])
* Usage: How to play WebRTC from SRS? [#307](https://github.com/ossrs/srs/issues/307) * How to use WebRTC? ([CN][v4_CN_WebRTC], [EN][v4_EN_WebRTC])
* Usage: How to publish WebRTC to SRS? [#307](https://github.com/ossrs/srs/issues/307)
Other important wiki: Other important wiki:
@ -1258,8 +1257,8 @@ Maintainers of SRS project:
* [Winlin](https://github.com/winlinvip): All areas of streaming server and documents. * [Winlin](https://github.com/winlinvip): All areas of streaming server and documents.
* [Wenjie](https://github.com/wenjiegit): The focus of his work is on the [HDS](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_DeliveryHDS) module. * [Wenjie](https://github.com/wenjiegit): The focus of his work is on the [HDS](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_DeliveryHDS) module.
* [Runner365](https://github.com/runner365): The focus of his work is on the [SRT](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_SRTWiki) module. * [Runner365](https://github.com/runner365): The focus of his work is on the [SRT](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_SRTWiki) module.
* [John](https://github.com/xiaozhihong): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_RTCWiki) module. * [John](https://github.com/xiaozhihong): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC) module.
* [B.P.Y(Bepartofyou)](https://github.com/Bepartofyou): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_RTCWiki) module. * [B.P.Y(Bepartofyou)](https://github.com/Bepartofyou): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC) module.
* [Lixin](https://github.com/xialixin): Focus on [GB28181](https://github.com/ossrs/srs/issues/1500) module. * [Lixin](https://github.com/xialixin): Focus on [GB28181](https://github.com/ossrs/srs/issues/1500) module.
A big THANK YOU goes to: A big THANK YOU goes to:
@ -1382,6 +1381,8 @@ Winlin
[v4_EN_SampleForward]: https://github.com/ossrs/srs/wiki/v4_EN_SampleForward [v4_EN_SampleForward]: https://github.com/ossrs/srs/wiki/v4_EN_SampleForward
[v4_CN_SampleRealtime]: https://github.com/ossrs/srs/wiki/v4_CN_SampleRealtime [v4_CN_SampleRealtime]: https://github.com/ossrs/srs/wiki/v4_CN_SampleRealtime
[v4_EN_SampleRealtime]: https://github.com/ossrs/srs/wiki/v4_EN_SampleRealtime [v4_EN_SampleRealtime]: https://github.com/ossrs/srs/wiki/v4_EN_SampleRealtime
[v4_CN_WebRTC]: https://github.com/ossrs/srs/wiki/v4_CN_WebRTC
[v4_EN_WebRTC]: https://github.com/ossrs/srs/wiki/v4_EN_WebRTC
[v4_CN_SampleARM]: https://github.com/ossrs/srs/wiki/v4_CN_SampleARM [v4_CN_SampleARM]: https://github.com/ossrs/srs/wiki/v4_CN_SampleARM
[v4_EN_SampleARM]: https://github.com/ossrs/srs/wiki/v4_EN_SampleARM [v4_EN_SampleARM]: https://github.com/ossrs/srs/wiki/v4_EN_SampleARM
[v4_CN_SampleIngest]: https://github.com/ossrs/srs/wiki/v4_CN_SampleIngest [v4_CN_SampleIngest]: https://github.com/ossrs/srs/wiki/v4_CN_SampleIngest
@ -1812,7 +1813,6 @@ Winlin
[bug #1543]: https://github.com/ossrs/srs/issues/1543 [bug #1543]: https://github.com/ossrs/srs/issues/1543
[bug #1509]: https://github.com/ossrs/srs/issues/1509 [bug #1509]: https://github.com/ossrs/srs/issues/1509
[bug #1575]: https://github.com/ossrs/srs/issues/1575 [bug #1575]: https://github.com/ossrs/srs/issues/1575
[bug #307]: https://github.com/ossrs/srs/issues/307
[bug #1070]: https://github.com/ossrs/srs/issues/1070 [bug #1070]: https://github.com/ossrs/srs/issues/1070
[bug #1580]: https://github.com/ossrs/srs/issues/1580 [bug #1580]: https://github.com/ossrs/srs/issues/1580
[bug #1547]: https://github.com/ossrs/srs/issues/1547 [bug #1547]: https://github.com/ossrs/srs/issues/1547

View file

@ -453,7 +453,7 @@ rtc_server {
# The exposed candidate IPs, response in SDP candidate line. It can be: # The exposed candidate IPs, response in SDP candidate line. It can be:
# * Retrieve server IP automatically, from all network interfaces. # * Retrieve server IP automatically, from all network interfaces.
# eth0 Retrieve server IP by specified network interface name. # TODO: Implements it. # 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. # 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: # You can specific more than one interface name:
# eth0 eth1 Use network interface eth0 and eth1. # TODO: Implements it. # eth0 eth1 Use network interface eth0 and eth1. # TODO: Implements it.
@ -461,10 +461,11 @@ rtc_server {
# 192.168.1.3 10.1.2.3 rtc.me # TODO: Implements it. # 192.168.1.3 10.1.2.3 rtc.me # TODO: Implements it.
# And by multiple ENV variables: # And by multiple ENV variables:
# $CANDIDATE $EIP # TODO: Implements it. # $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: * # default: *
candidate *; candidate *;
# The IP family filter for candidate, it can be: # The IP family filter for auto discover candidate, it can be:
# ipv4 Filter IP v4 candidates. # ipv4 Filter IP v4 candidates.
# ipv6 Filter IP v6 candidates. # ipv6 Filter IP v6 candidates.
# all Filter all IP v4 or v6 candidates. # all Filter all IP v4 or v6 candidates.
@ -534,21 +535,20 @@ vhost rtc.vhost.srs.com {
# Whether enable WebRTC server. # Whether enable WebRTC server.
# default: off # default: off
enabled on; enabled on;
# The strategy for bframe. # Whether support NACK.
# keep Keep bframe, which may make browser with playing problems. # default: on
# discard Discard bframe, maybe cause browser with little problems. nack on;
# default: keep # Whether directly use the packet, avoid copy.
bframe discard; # default: on
# The strategy for aac audio. nack_no_copy on;
# transcode Transcode aac to opus. # Whether support TWCC.
# discard Discard aac audio packet. # default: on
# default: transcode twcc on;
aac transcode;
# The timeout in seconds for session timeout. # The timeout in seconds for session timeout.
# Client will send ping(STUN binding request) to server, we use it as heartbeat. # Client will send ping(STUN binding request) to server, we use it as heartbeat.
# default: 30 # default: 30
stun_timeout 30; stun_timeout 30;
# The strick check when process stun. # The strict check when process stun.
# default: off # default: off
stun_strict_check on; stun_strict_check on;
# The role of dtls when peer is actpass: passive or active # The role of dtls when peer is actpass: passive or active
@ -560,8 +560,21 @@ vhost rtc.vhost.srs.com {
# Drop the packet with the pt(payload type), 0 never drop. # Drop the packet with the pt(payload type), 0 never drop.
# default: 0 # default: 0
drop_for_pt 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;
} }
# 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. # default: on, for RTC.
min_latency on; min_latency on;
play { play {
@ -570,25 +583,10 @@ vhost rtc.vhost.srs.com {
# default: 0 (For WebRTC) # default: 0 (For WebRTC)
mw_latency 0; mw_latency 0;
# Set the MW(merged-write) min messages. # Set the MW(merged-write) min messages.
# default: 0 (For Real-Time, min_latency on) # default: 0 (For Real-Time, that is min_latency on)
# default: 1 (For WebRTC, min_latency off) # default: 1 (For WebRTC, that is min_latency off)
mw_msgs 0; 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;
}
} }
############################################################################################# #############################################################################################

View file

@ -25,14 +25,13 @@ rtc_server {
# The $CANDIDATE means fetch from env, if not configed, use * as default. # The $CANDIDATE means fetch from env, if not configed, use * as default.
# #
# The * means retrieving server IP automatically, from all network interfaces, # The * means retrieving server IP automatically, from all network interfaces,
# @see https://github.com/ossrs/srs/issues/307#issuecomment-599028124 # @see https://github.com/ossrs/srs/wiki/v4_CN_RTCWiki#config-candidate
candidate $CANDIDATE; candidate $CANDIDATE;
} }
vhost __defaultVhost__ { vhost __defaultVhost__ {
rtc { rtc {
enabled on; enabled on;
bframe discard;
} }
http_remux { http_remux {
enabled on; enabled on;

View file

@ -3789,8 +3789,7 @@ srs_error_t SrsConfig::check_normal_config()
&& n != "play" && n != "publish" && n != "cluster" && n != "play" && n != "publish" && n != "cluster"
&& n != "security" && n != "http_remux" && n != "dash" && n != "security" && n != "http_remux" && n != "dash"
&& n != "http_static" && n != "hds" && n != "exec" && n != "http_static" && n != "hds" && n != "exec"
&& n != "in_ack_size" && n != "out_ack_size" && n != "rtc" && n != "nack" && n != "in_ack_size" && n != "out_ack_size" && n != "rtc") {
&& n != "twcc") {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal vhost.%s", n.c_str()); return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal vhost.%s", n.c_str());
} }
// for each sub directives of vhost. // for each sub directives of vhost.
@ -5104,7 +5103,7 @@ bool SrsConfig::get_rtc_enabled(string vhost)
bool SrsConfig::get_rtc_bframe_discard(string vhost) bool SrsConfig::get_rtc_bframe_discard(string vhost)
{ {
static bool DEFAULT = false; static bool DEFAULT = true;
SrsConfDirective* conf = get_rtc(vhost); SrsConfDirective* conf = get_rtc(vhost);
@ -5117,7 +5116,7 @@ bool SrsConfig::get_rtc_bframe_discard(string vhost)
return DEFAULT; return DEFAULT;
} }
return conf->arg0() == "discard"; return conf->arg0() != "keep";
} }
bool SrsConfig::get_rtc_aac_discard(string vhost) bool SrsConfig::get_rtc_aac_discard(string vhost)
@ -5214,7 +5213,7 @@ int SrsConfig::get_rtc_drop_for_pt(string vhost)
{ {
static int DEFAULT = 0; static int DEFAULT = 0;
SrsConfDirective* conf = get_vhost(vhost); SrsConfDirective* conf = get_rtc(vhost);
if (!conf) { if (!conf) {
return DEFAULT; return DEFAULT;
} }
@ -5231,7 +5230,7 @@ bool SrsConfig::get_rtc_nack_enabled(string vhost)
{ {
static bool DEFAULT = true; static bool DEFAULT = true;
SrsConfDirective* conf = get_vhost(vhost); SrsConfDirective* conf = get_rtc(vhost);
if (!conf) { if (!conf) {
return DEFAULT; return DEFAULT;
} }
@ -5241,11 +5240,6 @@ bool SrsConfig::get_rtc_nack_enabled(string vhost)
return DEFAULT; return DEFAULT;
} }
conf = conf->get("enabled");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return SRS_CONF_PERFER_TRUE(conf->arg0()); return SRS_CONF_PERFER_TRUE(conf->arg0());
} }
@ -5253,17 +5247,12 @@ bool SrsConfig::get_rtc_nack_no_copy(string vhost)
{ {
static bool DEFAULT = true; static bool DEFAULT = true;
SrsConfDirective* conf = get_vhost(vhost); SrsConfDirective* conf = get_rtc(vhost);
if (!conf) { if (!conf) {
return DEFAULT; return DEFAULT;
} }
conf = conf->get("nack"); conf = conf->get("nack_no_copy");
if (!conf) {
return DEFAULT;
}
conf = conf->get("no_copy");
if (!conf || conf->arg0().empty()) { if (!conf || conf->arg0().empty()) {
return DEFAULT; return DEFAULT;
} }
@ -5275,7 +5264,7 @@ bool SrsConfig::get_rtc_twcc_enabled(string vhost)
{ {
static bool DEFAULT = true; static bool DEFAULT = true;
SrsConfDirective* conf = get_vhost(vhost); SrsConfDirective* conf = get_rtc(vhost);
if (!conf) { if (!conf) {
return DEFAULT; return DEFAULT;
} }
@ -5285,11 +5274,6 @@ bool SrsConfig::get_rtc_twcc_enabled(string vhost)
return DEFAULT; return DEFAULT;
} }
conf = conf->get("enabled");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return SRS_CONF_PERFER_TRUE(conf->arg0()); return SRS_CONF_PERFER_TRUE(conf->arg0());
} }

View file

@ -179,6 +179,7 @@ public:
}; };
// HTTP Live Streaming, to transmux RTMP to HTTP FLV or other format. // HTTP Live Streaming, to transmux RTMP to HTTP FLV or other format.
// TODO: FIXME: Rename to SrsHttpLive
class SrsLiveStream : public ISrsHttpHandler class SrsLiveStream : public ISrsHttpHandler
{ {
private: private:

View file

@ -500,7 +500,8 @@ public:
virtual void on_unpublish() = 0; virtual void on_unpublish() = 0;
}; };
// live streaming source. // The live streaming source.
// TODO: FIXME: Rename to SrsLiveStream.
class SrsSource : public ISrsReloadHandler class SrsSource : public ISrsReloadHandler
{ {
friend class SrsOriginHub; friend class SrsOriginHub;

View file

@ -26,6 +26,6 @@
#define VERSION_MAJOR 4 #define VERSION_MAJOR 4
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_REVISION 91 #define VERSION_REVISION 92
#endif #endif