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

Change GB28181 to feature/gb28181. 4.0.127

This commit is contained in:
winlin 2021-06-16 08:27:37 +08:00
parent 4e93696bc6
commit 68c48e27f5
35 changed files with 14 additions and 9868 deletions

View file

@ -366,89 +366,6 @@ stream_caster {
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
#############################################################################################

View file

@ -1,143 +0,0 @@
# push gb28181 stream to SRS.
listen 1935;
max_connections 1000;
daemon off;
srs_log_tank console;
http_api {
enabled on;
listen 1985;
}
http_server {
enabled on;
listen 8080;
}
stats {
network 0;
}
stream_caster {
enabled on;
caster gb28181;
# 转发流到rtmp服务器地址与端口
# TODO: https://github.com/ossrs/srs/pull/1679/files#r400875104
# [stream] is VideoChannelCodecID(视频通道编码ID) for sip
# 自动创建的道通[stream] 是chid[ssrc] [ssrc]是rtp的ssrc
# [ssrc] rtp中的ssrc
output rtmp://127.0.0.1:1935/live/[stream];
# 接收设备端rtp流的多路复用端口
listen 9000;
# 多路复用端口类型on为tcpoff为udp
# 默认on
tcp_enable on;
# rtp接收监听端口范围最小值
rtp_port_min 58200;
# rtp接收监听端口范围最大值
rtp_port_max 58300;
# 是否等待关键帧之后,再转发,
# off:不需等待,直接转发
# on:等第一个关键帧后,再转发
wait_keyframe on;
# rtp包空闲等待时间如果指定时间没有收到任何包
# rtp监听连接自动停止发送BYE命令
rtp_idle_timeout 30;
# 是否转发音频流
# 目前只支持aac格式所以需要设备支持aac格式
# on:转发音频
# off:不转发音频,只有视频
# *注意*!!!:flv 只支持11025 22050 44100 三种
# 如果设备端没有三种中任何一个,转发时为自动选择一种格式
# 同时也会将adts的头封装在flv aac raw数据中
# 这样的话播放器为自动通过adts头自动选择采样频率
# 像ffplay, vlc都可以但是flash是没有声音
# 因为flash,只支持11025 22050 44100
audio_enable off;
# 是否开启rtp缓冲
# 开启之后能有效解决rtp乱序等问题
# tcp模式建议关闭
jitterbuffer_enable off;
# 服务器主机号可以域名或ip地址
# 也就是设备端将媒体发送的地址,如果是服务器是内外网
# 需要写外网地址,
# 调用api创建stream session时返回ip地址也是host
# $CANDIDATE 是系统环境变量,从环境变量获取地址,如果没有配置,用*
# *代表指定stats network 的网卡号地址如果没有配置network默认则是第0号网卡地址
# TODO: https://github.com/ossrs/srs/pull/1679/files#r400917594
host $CANDIDATE;
#根据收到ps rtp包自带创建rtmp媒体通道不需要api接口创建
#rtmp地址参数[stream] 就是通道id 格式chid[ssrc]
auto_create_channel off;
sip {
# 是否启用srs内部sip信令
# 为on信令走srs, off 只转发ps流
enabled on;
# sip监听udp端口
listen 5060;
# SIP server ID(SIP服务器ID).
# 设备端配置编号需要与该值一致,否则无法注册
serial 34020000002000000001;
# SIP server domain(SIP服务器域)
realm 3402000000;
# 服务端发送ack后接收回应的超时时间单位为秒
# 如果指定时间没有回应,认为失败
ack_timeout 30;
# 设备心跳维持时间,如果指定时间内(秒)没有接收一个心跳
# 认为设备离线
keepalive_timeout 120;
# 注册之后是否自动给设备端发送invite
# on: 是 off 不是需要通过api控制
auto_play on;
# 设备将流发送的端口,是否固定
# on 发送流到多路复用端口 如9000
# off 自动从rtp_mix_port - rtp_max_port 之间的值中
# 选一个可以用的端口
invite_port_fixed on;
# 向设备或下级域查询设备列表的间隔,单位(秒)
# 默认60秒
query_catalog_interval 60;
}
}
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/issues/307#issuecomment-599028124
candidate $CANDIDATE;
}
vhost __defaultVhost__ {
rtc {
enabled on;
bframe discard;
}
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
}
}

View file

@ -1,143 +0,0 @@
# push gb28181 stream to SRS.
listen 1935;
max_connections 1000;
daemon off;
srs_log_tank console;
http_api {
enabled on;
listen 1985;
}
http_server {
enabled on;
listen 8080;
}
stats {
network 0;
}
stream_caster {
enabled on;
caster gb28181;
# 转发流到rtmp服务器地址与端口
# TODO: https://github.com/ossrs/srs/pull/1679/files#r400875104
# [stream] is VideoChannelCodecID(视频通道编码ID) for sip
# 自动创建的道通[stream] 是chid[ssrc] [ssrc]是rtp的ssrc
# [ssrc] rtp中的ssrc
output rtmp://127.0.0.1:1935/live/[stream];
# 接收设备端rtp流的多路复用端口
listen 9000;
# 多路复用端口类型on为tcpoff为udp
# 默认off
tcp_enable on;
# rtp接收监听端口范围最小值
rtp_port_min 58200;
# rtp接收监听端口范围最大值
rtp_port_max 58300;
# 是否等待关键帧之后,再转发,
# off:不需等待,直接转发
# on:等第一个关键帧后,再转发
wait_keyframe on;
# rtp包空闲等待时间如果指定时间没有收到任何包
# rtp监听连接自动停止发送BYE命令
rtp_idle_timeout 30;
# 是否转发音频流
# 目前只支持aac格式所以需要设备支持aac格式
# on:转发音频
# off:不转发音频,只有视频
# *注意*!!!:flv 只支持11025 22050 44100 三种
# 如果设备端没有三种中任何一个,转发时为自动选择一种格式
# 同时也会将adts的头封装在flv aac raw数据中
# 这样的话播放器为自动通过adts头自动选择采样频率
# 像ffplay, vlc都可以但是flash是没有声音
# 因为flash,只支持11025 22050 44100
audio_enable off;
# 是否开启rtp缓冲
# 开启之后能有效解决rtp乱序等问题
# tcp模式建议关闭
jitterbuffer_enable off;
# 服务器主机号可以域名或ip地址
# 也就是设备端将媒体发送的地址,如果是服务器是内外网
# 需要写外网地址,
# 调用api创建stream session时返回ip地址也是host
# $CANDIDATE 是系统环境变量,从环境变量获取地址,如果没有配置,用*
# *代表指定stats network 的网卡号地址如果没有配置network默认则是第0号网卡地址
# TODO: https://github.com/ossrs/srs/pull/1679/files#r400917594
host $CANDIDATE;
#根据收到ps rtp包自带创建rtmp媒体通道不需要api接口创建
#rtmp地址参数[stream] 就是通道id 格式chid[ssrc]
auto_create_channel off;
sip {
# 是否启用srs内部sip信令
# 为on信令走srs, off 只转发ps流
enabled on;
# sip监听udp端口
listen 5060;
# SIP server ID(SIP服务器ID).
# 设备端配置编号需要与该值一致,否则无法注册
serial 34020000002000000001;
# SIP server domain(SIP服务器域)
realm 3402000000;
# 服务端发送ack后接收回应的超时时间单位为秒
# 如果指定时间没有回应,认为失败
ack_timeout 30;
# 设备心跳维持时间,如果指定时间内(秒)没有接收一个心跳
# 认为设备离线
keepalive_timeout 120;
# 注册之后是否自动给设备端发送invite
# on: 是 off 不是需要通过api控制
auto_play on;
# 设备将流发送的端口,是否固定
# on 发送流到多路复用端口 如9000
# off 自动从rtp_mix_port - rtp_max_port 之间的值中
# 选一个可以用的端口
invite_port_fixed on;
# 向设备或下级域查询设备列表的间隔,单位(秒)
# 默认60秒
query_catalog_interval 60;
}
}
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/issues/307#issuecomment-599028124
candidate $CANDIDATE;
}
vhost __defaultVhost__ {
rtc {
enabled on;
bframe discard;
}
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
}
}