mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
GB28181: Support GB28181-2016 protocol. v5.0.74 (#3201)
01. Support GB config as StreamCaster. 02. Support disable GB by --gb28181=off. 03. Add utests for SIP examples. 04. Wireshark plugin to decode TCP/9000 as rtp.rfc4571 05. Support MPEGPS program stream codec. 06. Add utest for PS stream codec. 07. Decode MPEGPS packet stream. 08. Carry RTP and PS packet as helper in PS message. 09. Support recover from error mode. 10. Support process by a pack of PS/TS messages. 11. Add statistic for recovered and msgs dropped. 12. Recover from err position fastly. 13. Define state machine for GB session. 14. Bind context to GB session. 15. Re-invite when media disconnected. 16. Update GitHub actions with GB28181. 17. Support parse CANDIDATE by env or pip. 18. Support mux GB28181 to RTMP. 19. Support regression test by srs-bench.
This commit is contained in:
parent
9c81a0e1bd
commit
5a420ece3b
298 changed files with 43343 additions and 763 deletions
|
@ -583,6 +583,52 @@ stream_caster {
|
|||
listen 8936;
|
||||
}
|
||||
|
||||
# For GB28181 server, see https://github.com/ossrs/srs/issues/3176
|
||||
# For SIP specification, see https://www.ietf.org/rfc/rfc3261.html
|
||||
# For GB28181 2016 spec, see https://openstd.samr.gov.cn/bzgk/gb/newGbInfo?hcno=469659DC56B9B8187671FF08748CEC89
|
||||
stream_caster {
|
||||
# Whether GB28181 server is enabled.
|
||||
# Default: off
|
||||
enabled off;
|
||||
# The caster type of stream, the casters:
|
||||
# gb28181, Push GB28181 stream to SRS.
|
||||
caster gb28181;
|
||||
# The output rtmp url.
|
||||
# For gb28181 caster, the typically output url:
|
||||
# rtmp://127.0.0.1/live/[stream]
|
||||
# The available variables:
|
||||
# [stream] The video channel codec ID.
|
||||
output rtmp://127.0.0.1/live/[stream];
|
||||
# The listen TCP/UDP port for stream caster.
|
||||
# For gb28181 caster, listen at TCP/UDP port. for example, 9000.
|
||||
# @remark We always enable bundle for media streams at this port.
|
||||
listen 9000;
|
||||
# SIP server for GB28181. Please note that this is only a demonstrated SIP server, please never use it in your
|
||||
# online production environment. Instead please use [jsip](https://github.com/usnistgov/jsip) and there is a demo
|
||||
# [srs-sip](https://github.com/ossrs/srs-sip) also base on it.
|
||||
sip {
|
||||
# Whether enable embedded SIP server.
|
||||
# Default: on
|
||||
enabled on;
|
||||
# The SIP listen port, for both TCP and UDP protocol.
|
||||
# Default: 5060
|
||||
listen 5060;
|
||||
# The SIP or media transport timeout in seconds.
|
||||
# Default: 60
|
||||
timeout 60;
|
||||
# When media disconnect, the wait time in seconds to re-invite device to publish. During this wait time, device
|
||||
# might send bye or unregister message(expire is 0), so that we will cancel the re-invite.
|
||||
# Default: 5
|
||||
reinvite 5;
|
||||
# The exposed candidate IPs, response in SDP connection line. It can be:
|
||||
# * Retrieve server IP automatically, from all network interfaces.
|
||||
# $CANDIDATE Read the IP from ENV variable, use * if not set.
|
||||
# x.x.x.x A specified IP address or DNS name, use * if 0.0.0.0.
|
||||
# Default: *
|
||||
candidate *;
|
||||
}
|
||||
}
|
||||
|
||||
#############################################################################################
|
||||
# other global sections
|
||||
#############################################################################################
|
||||
|
|
54
trunk/conf/gb28181.conf
Normal file
54
trunk/conf/gb28181.conf
Normal file
|
@ -0,0 +1,54 @@
|
|||
|
||||
listen 1935;
|
||||
max_connections 1000;
|
||||
daemon off;
|
||||
srs_log_tank console;
|
||||
|
||||
stream_caster {
|
||||
enabled on;
|
||||
caster gb28181;
|
||||
output rtmp://127.0.0.1/live/[stream];
|
||||
listen 9000;
|
||||
sip {
|
||||
enabled on;
|
||||
listen 5060;
|
||||
}
|
||||
}
|
||||
|
||||
http_server {
|
||||
enabled on;
|
||||
listen 8080;
|
||||
dir ./objs/nginx/html;
|
||||
}
|
||||
|
||||
http_api {
|
||||
enabled on;
|
||||
listen 1985;
|
||||
}
|
||||
stats {
|
||||
network 0;
|
||||
}
|
||||
rtc_server {
|
||||
enabled on;
|
||||
listen 8000; # UDP port
|
||||
# @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate
|
||||
candidate $CANDIDATE;
|
||||
}
|
||||
|
||||
vhost __defaultVhost__ {
|
||||
rtc {
|
||||
enabled on;
|
||||
# @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtmp-to-rtc
|
||||
rtmp_to_rtc on;
|
||||
# @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtc-to-rtmp
|
||||
rtc_to_rtmp on;
|
||||
}
|
||||
http_remux {
|
||||
enabled on;
|
||||
mount [vhost]/[app]/[stream].flv;
|
||||
}
|
||||
hls {
|
||||
enabled on;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,20 @@
|
|||
|
||||
listen 1935;
|
||||
max_connections 1000;
|
||||
daemon on;
|
||||
disable_daemon_for_docker off;
|
||||
srs_log_tank file;
|
||||
daemon on; disable_daemon_for_docker off; srs_log_tank file;
|
||||
|
||||
stream_caster {
|
||||
enabled on;
|
||||
caster gb28181;
|
||||
output rtmp://127.0.0.1/live/[stream];
|
||||
listen 9000;
|
||||
sip {
|
||||
enabled on;
|
||||
listen 5060;
|
||||
timeout 2.1;
|
||||
reinvite 1.2;
|
||||
}
|
||||
}
|
||||
|
||||
http_server {
|
||||
enabled on;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue