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

GB28181: Fix bug for parsing GB to RTC.

This commit is contained in:
winlin 2022-10-06 20:59:30 +08:00
parent 5a420ece3b
commit c12deded98
14 changed files with 122 additions and 62 deletions

View file

@ -540,67 +540,67 @@ vhost rtc.vhost.srs.com {
}
#############################################################################################
# Streamer sections
# Stream converter sections
#############################################################################################
# the streamer cast stream from other protocol to SRS over RTMP.
# The stream converter coverts stream from other protocol to SRS over RTMP.
# @see https://github.com/ossrs/srs/tree/develop#stream-architecture
# Push MPEGTS over UDP, see https://github.com/ossrs/srs/issues/250
# Push MPEGTS over UDP to SRS.
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:
# Whether stream converter is enabled.
# Default: off
enabled on;
# The type of stream converter, could be:
# mpegts_over_udp, push MPEG-TS over UDP and convert to RTMP.
caster mpegts_over_udp;
# The output rtmp url.
# For mpegts_over_udp converter, 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;
output rtmp://127.0.0.1/live/livestream;
# The listen port for stream converter.
# For mpegts_over_udp converter, listen at udp port. for example, 8935.
listen 8935;
}
# Push HTTP-FLV stream, see https://github.com/ossrs/srs/issues/2611
# Push FLV by HTTP POST to SRS.
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:
# Whether stream converter is enabled.
# Default: off
enabled on;
# The type of stream converter, could be:
# flv, push FLV by HTTP POST and convert to RTMP.
caster flv;
# The output rtmp url.
# For flv converter, the typically output url:
# rtmp://127.0.0.1/[app]/[stream]
# for example, POST to url:
# 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:
# 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;
output rtmp://127.0.0.1/[app]/[stream];
# The listen port for stream converter.
# For flv converter, listen at tcp port. for example, 8936.
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.
# Whether stream converter is enabled.
# Default: off
enabled off;
# The caster type of stream, the casters:
# gb28181, Push GB28181 stream to SRS.
# The type of stream converter, could be:
# gb28181, Push GB28181 stream and convert to RTMP.
caster gb28181;
# The output rtmp url.
# For gb28181 caster, the typically output url:
# For gb28181 converter, 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.
# The listen TCP/UDP port for stream converter.
# For gb28181 converter, 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

View file

@ -12,6 +12,8 @@ stream_caster {
sip {
enabled on;
listen 5060;
# @see https://ossrs.net/lts/zh-cn/docs/v5/doc/gb28181#config-candidate
candidate $CANDIDATE;
}
}

View file

@ -6,20 +6,40 @@ listen 1935;
max_connections 1000;
daemon off;
srs_log_tank console;
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
stream_caster {
enabled on;
caster flv;
output rtmp://127.0.0.1/[app]/[stream];
listen 8936;
}
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
http_api {
enabled on;
listen 1985;
}
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;
enabled on;
mount [vhost]/[app]/[stream].flv;
}
hls {
enabled on;
}
}

View file

@ -18,9 +18,29 @@ http_server {
listen 8080;
dir ./objs/nginx/html;
}
http_api {
enabled on;
listen 1985;
}
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;
enabled on;
mount [vhost]/[app]/[stream].flv;
}
hls {
enabled on;
}
}