648540858 / wvp-GB28181-pro

WEB VIDEO PLATFORM是一个基于GB28181-2016标准实现的网络视频平台,支持NAT穿透,支持海康、大华、宇视等品牌的IPC、NVR、DVR接入。支持国标级联,支持rtsp/rtmp等视频流转发到国标平台,支持rtsp/rtmp等推流转发到国标平台。
https://doc.wvp-pro.cn
MIT License
4.68k stars 1.4k forks source link

[ZLM HOOK] rtpServer收流超时 #1391

Closed project688 closed 3 months ago

project688 commented 4 months ago

[ZLM HOOK] rtpServer收流超时 WVP 日志==============:

2024-03-27 14:10:23.319 [wvp-12]  INFO --- c.g.iot.vmp.service.impl.MediaServerServiceImpl: 619 [ZLM] 设置成功 89wulian-one -> 192.168.70.137:8068
2024-03-27 14:10:23.319 [wvp-13]  INFO --- c.g.iot.vmp.media.zlm.event.ZLMStatusEventListener: 42 [ZLM] 上线 ID:89wulian-one
2024-03-27 14:10:23.319 [wvp-12]  INFO --- c.g.iot.vmp.service.impl.MediaServerServiceImpl: 441 [ZLM] 连接成功 89wulian-one - 172.20.10.13:8068 
2024-03-27 14:10:35.405 [wvp-2]  INFO --- c.g.i.v.g.t.e.r.i.m.n.c.KeepaliveNotifyMessageHandler: 64 [收到心跳] device: 41010500002000000001, callId: 53f0f857204bf95d@172.20.10.13
2024-03-27 14:11:02.389 [wvp-13]  INFO --- c.g.i.v.g.t.e.r.i.m.r.c.CatalogResponseMessageHandler: 136 [收到通道]设备: 41010500002000000001 -> 1个,1/1
2024-03-27 14:11:35.481 [wvp-10]  INFO --- c.g.i.v.g.t.e.r.i.m.n.c.KeepaliveNotifyMessageHandler: 64 [收到心跳] device: 41010500002000000001, callId: 5bea0b7a67876980@172.20.10.13
2024-03-27 14:11:47.517 [http-nio-8080-exec-2]  INFO --- c.g.iot.vmp.vmanager.gb28181.play.PlayController: 104 [开始点播] deviceId:41010500002000000001, channelId:41010500002000000001, 
2024-03-27 14:11:47.540 [http-nio-8080-exec-2]  INFO --- ZLMRTPServerFactory: 49 {"code":0,"exist":false}
2024-03-27 14:11:47.546 [http-nio-8080-exec-2]  INFO --- ZLMRTPServerFactory: 97 {"code":0,"port":34502}
2024-03-27 14:11:47.547 [http-nio-8080-exec-2]  INFO --- com.genersoft.iot.vmp.service.impl.PlayServiceImpl: 388 [点播开始] deviceId: 41010500002000000001, channelId: 41010500002000000001,码流类型:null, 收流端口: 34502, 码流:41010500002000000001_41010500002000000001, 收流模式:UDP, SSRC: 0105009878, SSRC校验:false
2024-03-27 14:11:47.564 [http-nio-8080-exec-2]  INFO --- c.g.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander: 286 41010500002000000001_41010500002000000001 分配的ZLM为: 89wulian-one [172.20.10.13:34502]
{on_stream_changed={com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange@76029cf=com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander$$Lambda$1254/2058286892@407e2151}}
2024-03-27 14:11:47.759 [wvp-16]  INFO --- c.g.i.v.g.t.e.r.impl.InviteResponseProcessor: 91 [回复ack] 41010500002000000001-> 172.20.10.3:5888 
2024-03-27 14:12:02.552 [http-nio-8080-exec-8]  INFO --- c.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener: 852 [ZLM HOOK] rtpServer收流超时:89wulian-one->41010500002000000001_41010500002000000001(0)

ZLM 日志==============:

2024-03-26 23:10:24.092 I [MediaServer] [21196-MediaServer] EventPoller.cpp:500 EventPollerPool | EventPoller created size: 4
2024-03-26 23:10:24.092 I [MediaServer] [21196-MediaServer] main.cpp:350 start_main | 已启动http api 接口
2024-03-26 23:10:24.094 I [MediaServer] [21196-MediaServer] main.cpp:352 start_main | 已启动http hook 接口
2024-03-26 23:10:24.095 I [MediaServer] [21196-MediaServer] TcpServer.cpp:218 start_l | TCP server listening on [::]: 554
2024-03-26 23:10:24.096 I [MediaServer] [21196-MediaServer] TcpServer.cpp:218 start_l | TCP server listening on [::]: 1935
2024-03-26 23:10:24.096 I [MediaServer] [21196-MediaServer] TcpServer.cpp:218 start_l | TCP server listening on [::]: 8068
2024-03-26 23:10:24.097 I [MediaServer] [21196-MediaServer] TcpServer.cpp:218 start_l | TCP server listening on [::]: 443
2024-03-26 23:10:24.099 I [MediaServer] [21196-MediaServer] TcpServer.cpp:218 start_l | TCP server listening on [::]: 10000
2024-03-26 23:10:24.099 I [MediaServer] [21196-MediaServer] UdpServer.cpp:120 start_l | UDP server bind to [::]: 10000
2024-03-26 23:10:24.101 I [MediaServer] [21196-MediaServer] UdpServer.cpp:120 start_l | UDP server bind to [::]: 9000
2024-03-26 23:10:24.374 D [MediaServer] [21196-event poller 1] WebApi.cpp:265 http api debug | 
# request:
POST /index/api/setServerConfig
# header:
Accept-Encoding : gzip
Connection : Keep-Alive
Content-Length : 1241
Content-Type : application/x-www-form-urlencoded
Host : 192.168.70.137:8068
User-Agent : okhttp/4.10.0
# content:
secret=111111&hook.on_rtsp_realm=&hook.on_stream_changed=http%3A%2F%2F172.20.10.13%3A8080%2Findex%2Fhook%2Fon_stream_changed&hook.on_flow_report=&hook.on_publish=http%3A%2F%2F172.20.10.13%3A8080%2Findex%2Fhook%2Fon_publish&ffmpeg.snap=%25s%20-rtsp_transport%20tcp%20-i%20%25s%20-y%20-f%20mjpeg%20-frames%3Av%201%20%25s&hook.timeoutSec=20&protocol.continue_push_ms=3000&hook.enable=1&hook.on_rtp_server_timeout=http%3A%2F%2F172.20.10.13%3A8080%2Findex%2Fhook%2Fon_rtp_server_timeout&hook.on_http_access=&hook.on_stream_not_found=http%3A%2F%2F172.20.10.13%3A8080%2Findex%2Fhook%2Fon_stream_not_found&hook.on_send_rtp_stopped=http%3A%2F%2F172.20.10.13%3A8080%2Findex%2Fhook%2Fon_send_rtp_stopped&rtp_proxy.port_range=30000-35000&hook.on_rtsp_auth=&hook.on_record_mp4=http%3A%2F%2F172.20.10.13%3A8080%2Findex%2Fhook%2Fon_record_mp4&hook.on_stream_none_reader=http%3A%2F%2F172.20.10.13%3A8080%2Findex%2Fhook%2Fon_stream_none_reader&hook.on_server_keepalive=http%3A%2F%2F172.20.10.13%3A8080%2Findex%2Fhook%2Fon_server_keepalive&hook.on_shell_login=&hook.on_play=http%3A%2F%2F172.20.10.13%3A8080%2Findex%2Fhook%2Fon_play&api.secret=111111&hook.on_server_started=http%3A%2F%2F172.20.10.13%3A8080%2Findex%2Fhook%2Fon_server_started&hook.on_record_ts=
# response:
{
    "changed" : 0,
    "code" : 0
}

2024-03-26 23:10:24.383 D [MediaServer] [21196-event poller 1] WebApi.cpp:265 http api debug | 
# request:
POST /index/api/getMediaList
# header:
Accept-Encoding : gzip
Connection : Keep-Alive
Content-Length : 13
Content-Type : application/x-www-form-urlencoded
Host : 192.168.70.137:8068
User-Agent : okhttp/4.10.0
# content:
secret=111111
# response:
{
    "code" : 0
}

2024-03-26 23:11:48.597 D [MediaServer] [21196-event poller 2] WebApi.cpp:265 http api debug | 
# request:
POST /index/api/getRtpInfo
# header:
Accept-Encoding : gzip
Connection : Keep-Alive
Content-Length : 65
Content-Type : application/x-www-form-urlencoded
Host : 192.168.70.137:8068
User-Agent : okhttp/4.10.0
# content:
secret=111111&stream_id=41010500002000000001_41010500002000000001
# response:
{
    "code" : 0,
    "exist" : false
}

2024-03-26 23:11:48.601 I [MediaServer] [21196-event poller 2] Rtsp.cpp:421 getPortPair | got port from pool:34502-34503
2024-03-26 23:11:48.603 D [MediaServer] [21196-event poller 2] WebApi.cpp:265 http api debug | 
# request:
POST /index/api/openRtpServer
# header:
Accept-Encoding : gzip
Connection : Keep-Alive
Content-Length : 110
Content-Type : application/x-www-form-urlencoded
Host : 192.168.70.137:8068
User-Agent : okhttp/4.10.0
# content:
secret=111111&re_use_port=0&stream_id=41010500002000000001_41010500002000000001&port=0&only_audio=0&tcp_mode=0
# response:
{
    "code" : 0,
    "port" : 34502
}

2024-03-26 23:12:03.604 I [MediaServer] [21196-event poller 2] Rtsp.cpp:430 operator() | return port to pool:34502-34503
2024-03-26 23:14:48.653 D [MediaServer] [21196-event poller 0] WebApi.cpp:265 http api debug | 
# request:
POST /index/api/closeRtpServer
# header:
Accept-Encoding : gzip
Connection : Keep-Alive
Content-Length : 65
Content-Type : application/x-www-form-urlencoded
Host : 192.168.70.137:8068
User-Agent : okhttp/4.10.0
# content:
secret=111111&stream_id=41010500002000000001_41010500002000000001
# response:
{
    "code" : 0,
    "hit" : 0
}

2024-03-26 23:14:48.657 D [MediaServer] [21196-event poller 0] WebApi.cpp:265 http api debug | 
# request:
POST /index/api/close_streams
# header:
Accept-Encoding : gzip
Connection : Keep-Alive
Content-Length : 101
Content-Type : application/x-www-form-urlencoded
Host : 192.168.70.137:8068
User-Agent : okhttp/4.10.0
# content:
secret=111111&app=rtp&vhost=__defaultVhost__&stream=41010500002000000001_41010500002000000001&force=1
# response:
{
    "code" : 0,
    "count_closed" : 0,
    "count_hit" : 0
}

2024-03-26 23:14:48.662 D [MediaServer] [21196-event poller 0] WebApi.cpp:265 http api debug | 
# request:
POST /index/api/closeRtpServer
# header:
Accept-Encoding : gzip
Connection : Keep-Alive
Content-Length : 65
Content-Type : application/x-www-form-urlencoded
Host : 192.168.70.137:8068
User-Agent : okhttp/4.10.0
# content:
secret=111111&stream_id=41010500002000000001_41010500002000000001
# response:
{
    "code" : 0,
    "hit" : 0
}

2024-03-26 23:14:48.662 D [MediaServer] [21196-event poller 0] WebApi.cpp:265 http api debug | 
# request:
POST /index/api/closeRtpServer
# header:
Accept-Encoding : gzip
Connection : Keep-Alive
Content-Length : 65
Content-Type : application/x-www-form-urlencoded
Host : 192.168.70.137:8068
User-Agent : okhttp/4.10.0
# content:
secret=111111&stream_id=41010500002000000001_41010500002000000001
# response:
{
    "code" : 0,
    "hit" : 0
}
mengxing2017 commented 4 months ago

看这情况,大概率是sdp-ip没填公网ip,你这环境应该是公网环境吧

project688 commented 3 months ago

看这情况,大概率是sdp-ip没填公网ip,你这环境应该是公网环境吧 wvp在本机172.20.10.13,zlm在虚拟机192.168.70.137


server:
port: 8080
# [可选] HTTPS配置, 默认不开启
ssl:
# [可选] 是否开启HTTPS访问
enabled: false
# [可选] 证书文件路径,放置在resource/目录下即可,修改xxx为文件名
key-store: classpath:test.monitor.89iot.cn.jks
# [可选] 证书密码
key-store-password: gpf64qmw
# [可选] 证书类型, 默认为jks,根据实际修改
key-store-type: JKS

作为28181服务器的配置

sip:

[必须修改] 本机的IP,对应你的网卡,监听什么ip就是使用什么网卡,

如果要监听多张网卡,可以使用逗号分隔多个IP, 例如: 192.168.1.4,10.0.0.4

如果不明白,就使用0.0.0.0,大部分情况都是可以的

请不要使用127.0.0.1,任何包括localhost在内的域名都是不可以的。

ip: 172.20.10.13

[可选] 28181服务监听的端口

port: 8116

根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007)

后两位为行业编码,定义参照附录D.3

3701020049标识山东济南历下区 信息行业接入

[可选]

domain: 4101050000

[可选]

id: 41010500002000000001

[可选] 默认设备认证密码,后续扩展使用设备单独密码, 移除密码将不进行校验

password: bajiuwulian1006

是否存储alarm信息

alarm: true

#zlm 默认服务器配置

media: id: 89wulian-one

[必须修改] zlm服务器的内网IP

ip: 192.168.70.137

[必须修改] zlm服务器的http.port

http-port: 8068

[可选] 返回流地址时的ip,置空使用 media.ip

stream-ip: 192.168.70.137

[可选] wvp在国标信令中使用的ip,此ip为摄像机可以访问到的ip, 置空使用 media.ip

sdp-ip: 172.20.10.13

[可选] zlm服务器的hook所使用的IP, 默认使用sip.ip

hook-ip: 172.20.10.13

[可选] zlm服务器的http.sslport, 置空使用zlm配置文件配置

http-ssl-port: 443

[可选] zlm服务器的hook.admin_params=secret

secret: 111111

启用多端口模式, 多端口模式使用端口区分每路流,兼容性更好。 单端口使用流的ssrc区分, 点播超时建议使用多端口测试

rtp:

[可选] 是否启用多端口模式, 开启后会在portRange范围内选择端口用于媒体流传输

enable: true
# [可选] 在此范围内选择端口用于媒体流传输, 必须提前在zlm上配置该属性,不然自动配置此属性可能不成功
port-range: 30000,35000 # 端口范围
# [可选] 国标级联在此范围内选择端口发送媒体流,
send-port-range: 30000,35000 # 端口范围

录像辅助服务, 部署此服务可以实现zlm录像的管理与下载, 0 表示不使用

record-assist-port: 18081 ``

mengxing2017 commented 3 months ago

网络是桥接模式吗

---原始邮件--- 发件人: @.> 发送时间: 2024年3月28日(周四) 上午10:59 收件人: @.>; 抄送: @.**@.>; 主题: Re: [648540858/wvp-GB28181-pro] [ZLM HOOK] rtpServer收流超时 (Issue #1391)

看这情况,大概率是sdp-ip没填公网ip,你这环境应该是公网环境吧 wvp在本机172.20.10.13,zlm在虚拟机192.168.70.137

server: port: 8080

[可选] HTTPS配置, 默认不开启

ssl:

[可选] 是否开启HTTPS访问

enabled: false

[可选] 证书文件路径,放置在resource/目录下即可,修改xxx为文件名

key-store: classpath:test.monitor.89iot.cn.jks

[可选] 证书密码

key-store-password: gpf64qmw

[可选] 证书类型, 默认为jks,根据实际修改

key-store-type: JKS

作为28181服务器的配置

sip:

[必须修改] 本机的IP,对应你的网卡,监听什么ip就是使用什么网卡,

如果要监听多张网卡,可以使用逗号分隔多个IP, 例如: 192.168.1.4,10.0.0.4

如果不明白,就使用0.0.0.0,大部分情况都是可以的

请不要使用127.0.0.1,任何包括localhost在内的域名都是不可以的。

ip: 172.20.10.13

[可选] 28181服务监听的端口

port: 8116

根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007)

后两位为行业编码,定义参照附录D.3

3701020049标识山东济南历下区 信息行业接入

[可选]

domain: 4101050000

[可选]

id: 41010500002000000001

[可选] 默认设备认证密码,后续扩展使用设备单独密码, 移除密码将不进行校验

password: bajiuwulian1006

是否存储alarm信息

alarm: true

zlm 默认服务器配置

media: id: 89wulian-one

[必须修改] zlm服务器的内网IP

ip: 192.168.70.137

[必须修改] zlm服务器的http.port

http-port: 8068

[可选] 返回流地址时的ip,置空使用 media.ip

stream-ip: 192.168.70.137

[可选] wvp在国标信令中使用的ip,此ip为摄像机可以访问到的ip, 置空使用 media.ip

sdp-ip: 172.20.10.13

[可选] zlm服务器的hook所使用的IP, 默认使用sip.ip

hook-ip: 172.20.10.13

[可选] zlm服务器的http.sslport, 置空使用zlm配置文件配置

http-ssl-port: 443

[可选] zlm服务器的hook.admin_params=secret

secret: 111111

启用多端口模式, 多端口模式使用端口区分每路流,兼容性更好。 单端口使用流的ssrc区分, 点播超时建议使用多端口测试

rtp:

[可选] 是否启用多端口模式, 开启后会在portRange范围内选择端口用于媒体流传输

enable: true

[可选] 在此范围内选择端口用于媒体流传输, 必须提前在zlm上配置该属性,不然自动配置此属性可能不成功

port-range: 30000,35000 # 端口范围

[可选] 国标级联在此范围内选择端口发送媒体流,

send-port-range: 30000,35000 # 端口范围

录像辅助服务, 部署此服务可以实现zlm录像的管理与下载, 0 表示不使用

record-assist-port: 18081

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

mengxing2017 commented 3 months ago

zlm的ip地址,摄像头可以访问吗

---原始邮件--- 发件人: @.> 发送时间: 2024年3月28日(周四) 上午10:59 收件人: @.>; 抄送: @.**@.>; 主题: Re: [648540858/wvp-GB28181-pro] [ZLM HOOK] rtpServer收流超时 (Issue #1391)

看这情况,大概率是sdp-ip没填公网ip,你这环境应该是公网环境吧 wvp在本机172.20.10.13,zlm在虚拟机192.168.70.137

server: port: 8080

[可选] HTTPS配置, 默认不开启

ssl:

[可选] 是否开启HTTPS访问

enabled: false

[可选] 证书文件路径,放置在resource/目录下即可,修改xxx为文件名

key-store: classpath:test.monitor.89iot.cn.jks

[可选] 证书密码

key-store-password: gpf64qmw

[可选] 证书类型, 默认为jks,根据实际修改

key-store-type: JKS

作为28181服务器的配置

sip:

[必须修改] 本机的IP,对应你的网卡,监听什么ip就是使用什么网卡,

如果要监听多张网卡,可以使用逗号分隔多个IP, 例如: 192.168.1.4,10.0.0.4

如果不明白,就使用0.0.0.0,大部分情况都是可以的

请不要使用127.0.0.1,任何包括localhost在内的域名都是不可以的。

ip: 172.20.10.13

[可选] 28181服务监听的端口

port: 8116

根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007)

后两位为行业编码,定义参照附录D.3

3701020049标识山东济南历下区 信息行业接入

[可选]

domain: 4101050000

[可选]

id: 41010500002000000001

[可选] 默认设备认证密码,后续扩展使用设备单独密码, 移除密码将不进行校验

password: bajiuwulian1006

是否存储alarm信息

alarm: true

zlm 默认服务器配置

media: id: 89wulian-one

[必须修改] zlm服务器的内网IP

ip: 192.168.70.137

[必须修改] zlm服务器的http.port

http-port: 8068

[可选] 返回流地址时的ip,置空使用 media.ip

stream-ip: 192.168.70.137

[可选] wvp在国标信令中使用的ip,此ip为摄像机可以访问到的ip, 置空使用 media.ip

sdp-ip: 172.20.10.13

[可选] zlm服务器的hook所使用的IP, 默认使用sip.ip

hook-ip: 172.20.10.13

[可选] zlm服务器的http.sslport, 置空使用zlm配置文件配置

http-ssl-port: 443

[可选] zlm服务器的hook.admin_params=secret

secret: 111111

启用多端口模式, 多端口模式使用端口区分每路流,兼容性更好。 单端口使用流的ssrc区分, 点播超时建议使用多端口测试

rtp:

[可选] 是否启用多端口模式, 开启后会在portRange范围内选择端口用于媒体流传输

enable: true

[可选] 在此范围内选择端口用于媒体流传输, 必须提前在zlm上配置该属性,不然自动配置此属性可能不成功

port-range: 30000,35000 # 端口范围

[可选] 国标级联在此范围内选择端口发送媒体流,

send-port-range: 30000,35000 # 端口范围

录像辅助服务, 部署此服务可以实现zlm录像的管理与下载, 0 表示不使用

record-assist-port: 18081

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

project688 commented 3 months ago

可以访问,设备注册成功,点击播放提示‘远程查看开始’,只是收流超时,防火墙都是关的

mengxing2017 commented 3 months ago

摄像头ip是什么?网络是桥接模式吗

---原始邮件--- 发件人: @.> 发送时间: 2024年3月28日(周四) 中午1:12 收件人: @.>; 抄送: @.**@.>; 主题: Re: [648540858/wvp-GB28181-pro] [ZLM HOOK] rtpServer收流超时 (Issue #1391)

可以访问,设备注册成功,点击播放提示‘远程查看开始’,只是收流超时,防火墙都是关的

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

project688 commented 3 months ago

摄像头ip是172.20.10.3,网络用的手机热点局域网

mengxing2017 commented 3 months ago

这ip明显访问不到zlm,而且你一直都不回答使用的是否是桥接模式,网络是否互联互通的一个都不回答

---原始邮件--- 发件人: @.> 发送时间: 2024年3月28日(周四) 下午3:15 收件人: @.>; 抄送: @.**@.>; 主题: Re: [648540858/wvp-GB28181-pro] [ZLM HOOK] rtpServer收流超时 (Issue #1391)

摄像头ip是172.20.10.3,网络用的手机热点局域网

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

zc640618 commented 3 months ago

国标设备页面→流传输模式→TCP被动模式