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.85k stars 1.44k forks source link

技术咨询 使用GB28181连接录像机,播放选择码流不生效 #1404

Closed wbkong closed 5 months ago

wbkong commented 6 months ago

环境信息:

内容描述: 这边有需要,就是希望通过降低播放的画质达到降低带宽压力。 在测试的时候发现,如果通过配置通道的码流类型,选择子码流,可以达到降低画质的效果。 最开始是先测试wvp直连摄像枪,发现TP-LINK和水星的都能通过这个方式去控制 然后就测试wvp直连录像机,录像机的通道对应的就是摄像枪,但这个时候发现,无论我选什么方式的码流,在播放监控的时候都是默认主码流。 或者有没其他什么办法可以达到降低播放画质也可以给我提供一下,谢谢

截图
红框的是录像机 image 通道选择子码流 image 能正常播放,但是码流显示的是主码流的分辨率 image

抓包文件

日志 wvp的日志

2024-04-01 17:31:51.373 [wvp-3]  INFO --- c.g.i.v.g.t.e.r.i.m.n.c.KeepaliveNotifyMessageHandler: 64 [收到心跳] device: 34020000001320000205, callId: NN.r7hIsGGEOn72vG2BMZkuwrzUvZskB
2024-04-01 17:32:05.154 [wvp-4]  INFO --- c.g.i.v.g.t.e.r.i.m.n.c.KeepaliveNotifyMessageHandler: 64 [收到心跳] device: 34020000001320000012, callId: .8V8ZhXQ5SPClRj0vkd.i6zdJhbqsgiR
2024-04-01 17:32:51.323 [wvp-7]  INFO --- c.g.i.v.g.t.e.r.i.m.n.c.KeepaliveNotifyMessageHandler: 64 [收到心跳] device: 34020000001320000205, callId: 2d5BLPbXakEji0ZisMFo.KSw.Nz7VYTF
2024-04-01 17:33:00.582 [http-nio-18080-exec-9]  INFO --- c.g.iot.vmp.vmanager.gb28181.play.PlayController: 104 [开始点播] deviceId:34020000001320000205, channelId:34020000001310000051, 
2024-04-01 17:33:00.601 [http-nio-18080-exec-9]  INFO --- ZLMRTPServerFactory: 49 {"code":0,"exist":false}
2024-04-01 17:33:00.603 [http-nio-18080-exec-9]  INFO --- ZLMRTPServerFactory: 97 {"code":0,"port":50022}
2024-04-01 17:33:00.604 [http-nio-18080-exec-9]  INFO --- com.genersoft.iot.vmp.service.impl.PlayServiceImpl: 388 [点播开始] deviceId: 34020000001320000205, channelId: 34020000001310000051,码流类型:stream:1, 收流端口: 50022, 码流:34020000001320000205_34020000001310000051, 收流模式:UDP, SSRC: 0105003031, SSRC校验:false
2024-04-01 17:33:00.610 [http-nio-18080-exec-9]  INFO --- c.g.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander: 286 34020000001320000205_34020000001310000051 分配的ZLM为: hc3rwQvQP3eNXWbd1 [192.168.3.111:50022]
{on_stream_changed={com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange@3dc78d1b=com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander$$Lambda$1401/0x0000000800aecc40@684a8cab}}
2024-04-01 17:33:00.652 [wvp-9]  INFO --- c.g.i.v.g.t.e.r.impl.InviteResponseProcessor: 91 [回复ack] 34020000001320000205-> 192.168.0.31:5060 
2024-04-01 17:33:00.656 [wvp-9]  INFO --- com.genersoft.iot.vmp.service.impl.PlayServiceImpl: 794 [Invite 200OK] 收到invite 200, 发现下级自定义了ssrc: 105003031
2024-04-01 17:33:03.027 [http-nio-18080-exec-6]  INFO --- c.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener: 203 [ZLM HOOK]推流鉴权:hc3rwQvQP3eNXWbd1->OnPublishHookParam{id='34020000001320000205_34020000001310000051', app='rtp', stream='34020000001320000205_34020000001310000051', ip='192.168.0.31', params='', port=59550, schema='rtp', vhost='__defaultVhost__'}
2024-04-01 17:33:03.047 [http-nio-18080-exec-6]  INFO --- c.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener: 336 [ZLM HOOK]推流鉴权 响应:hc3rwQvQP3eNXWbd1->OnPublishHookParam{id='34020000001320000205_34020000001310000051', app='rtp', stream='34020000001320000205_34020000001310000051', ip='192.168.0.31', params='', port=59550, schema='rtp', vhost='__defaultVhost__'}->>>>HookResultForOnPublish{enable_audio=false, enable_mp4=false, mp4_max_second=0, mp4_save_path='null', stream_replace='null', modify_stamp='null'}
2024-04-01 17:33:03.185 [http-nio-18080-exec-4]  INFO --- c.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener: 349 [ZLM HOOK] 流注册, hc3rwQvQP3eNXWbd1->fmp4->rtp/34020000001320000205_34020000001310000051
2024-04-01 17:33:03.188 [http-nio-18080-exec-8]  INFO --- c.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener: 349 [ZLM HOOK] 流注册, hc3rwQvQP3eNXWbd1->rtmp->rtp/34020000001320000205_34020000001310000051
2024-04-01 17:33:03.189 [http-nio-18080-exec-5]  INFO --- c.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener: 349 [ZLM HOOK] 流注册, hc3rwQvQP3eNXWbd1->ts->rtp/34020000001320000205_34020000001310000051
2024-04-01 17:33:03.189 [http-nio-18080-exec-7]  INFO --- c.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener: 349 [ZLM HOOK] 流注册, hc3rwQvQP3eNXWbd1->rtsp->rtp/34020000001320000205_34020000001310000051
2024-04-01 17:33:03.191 [wvp-1]  INFO --- com.genersoft.iot.vmp.service.impl.PlayServiceImpl: 451 收到订阅消息: OnStreamChangedHookParam{regist=true, app='rtp', stream='34020000001320000205_34020000001310000051', severId='null'}
2024-04-01 17:33:03.215 [wvp-1]  INFO --- com.genersoft.iot.vmp.service.impl.PlayServiceImpl: 468 [点播成功] deviceId: 34020000001320000205, channelId:34020000001310000051, 码流类型:stream:1
2024-04-01 17:33:03.215 [wvp-1]  INFO --- com.genersoft.iot.vmp.service.impl.PlayServiceImpl: 592 [请求截图]: 34020000001320000205_34020000001310000051.jpg
2024-04-01 17:33:03.218 [wvp-1]  INFO --- com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils: 185 Request{method=GET, url=http://192.168.3.111:6080/index/api/getSnap?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&expire_sec=1&url=rtsp%3A%2F%2F127.0.0.1%3A554%2Frtp%2F34020000001320000205_34020000001310000051&timeout_sec=15}
2024-04-01 17:33:03.225 [wvp-1]  INFO --- c.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener: 384 流变化:注册->true, app->rtp, stream->34020000001320000205_34020000001310000051
2024-04-01 17:33:05.195 [wvp-5]  INFO --- c.g.i.v.g.t.e.r.i.m.n.c.KeepaliveNotifyMessageHandler: 64 [收到心跳] device: 34020000001320000012, callId: zAoc911yI1z5WAVxfb00P24BynB9.TVX
2024-04-01 17:33:15.200 [http-nio-18080-exec-10]  INFO --- c.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener: 349 [ZLM HOOK] 流注册, hc3rwQvQP3eNXWbd1->hls->rtp/34020000001320000205_34020000001310000051

ZLM的日志

# request:

POST /index/api/getMediaList

# header:

Accept-Encoding : gzip

Connection : Keep-Alive

Content-Length : 78

Content-Type : application/x-www-form-urlencoded

Host : 192.168.3.111:6080

User-Agent : okhttp/4.10.0

# content:

secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&schema=rtsp&vhost=__defaultVhost__

# response:

{
    "code" : 0
}

2024-04-01 17:46:11.649 D [MediaServer.exe] [3640-event poller 1] WebApi.cpp:250 http api debug | 

# request:

POST /index/api/setServerConfig

# header:

Accept-Encoding : gzip

Connection : Keep-Alive

Content-Length : 1321

Content-Type : application/x-www-form-urlencoded

Host : 192.168.3.111:6080

User-Agent : okhttp/4.10.0

# content:

secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&hook.on_rtsp_realm=&hook.on_stream_changed=http%3A%2F%2F192.168.3.111%3A18080%2Findex%2Fhook%2Fon_stream_changed&hook.on_flow_report=&hook.on_publish=http%3A%2F%2F192.168.3.111%3A18080%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%2F192.168.3.111%3A18080%2Findex%2Fhook%2Fon_rtp_server_timeout&hook.on_http_access=&hook.on_stream_not_found=http%3A%2F%2F192.168.3.111%3A18080%2Findex%2Fhook%2Fon_stream_not_found&hook.on_send_rtp_stopped=http%3A%2F%2F192.168.3.111%3A18080%2Findex%2Fhook%2Fon_send_rtp_stopped&rtp_proxy.port_range=50000-50300&hook.on_rtsp_auth=&hook.on_record_mp4=http%3A%2F%2F192.168.3.111%3A18080%2Findex%2Fhook%2Fon_record_mp4&hook.on_stream_none_reader=http%3A%2F%2F192.168.3.111%3A18080%2Findex%2Fhook%2Fon_stream_none_reader&hook.on_server_keepalive=http%3A%2F%2F192.168.3.111%3A18080%2Findex%2Fhook%2Fon_server_keepalive&hook.on_shell_login=&hook.on_play=http%3A%2F%2F192.168.3.111%3A18080%2Findex%2Fhook%2Fon_play&api.secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&hook.on_server_started=http%3A%2F%2F192.168.3.111%3A18080%2Findex%2Fhook%2Fon_server_started&hook.on_record_ts=

# response:

{
    "changed" : 0,
    "code" : 0
}

2024-04-01 17:46:11.655 D [MediaServer.exe] [3640-event poller 1] WebApi.cpp:250 http api debug | 

# request:

POST /index/api/getMediaList

# header:

Accept-Encoding : gzip

Connection : Keep-Alive

Content-Length : 43

Content-Type : application/x-www-form-urlencoded

Host : 192.168.3.111:6080

User-Agent : okhttp/4.10.0

# content:

secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc

# response:

{
    "code" : 0
}

2024-04-01 17:46:17.977 D [MediaServer.exe] [3640-event poller 1] WebApi.cpp:250 http api debug | 

# request:

POST /index/api/getRtpInfo

# header:

Accept-Encoding : gzip

Connection : Keep-Alive

Content-Length : 95

Content-Type : application/x-www-form-urlencoded

Host : 192.168.3.111:6080

User-Agent : okhttp/4.10.0

# content:

secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&stream_id=34020000001320000205_34020000001310000051

# response:

{
    "code" : 0,
    "exist" : false
}

2024-04-01 17:46:17.980 I [MediaServer.exe] [3640-event poller 1] Rtsp.cpp:440 getPortPair | got port from pool:50000-50001
2024-04-01 17:46:17.980 D [MediaServer.exe] [3640-event poller 1] WebApi.cpp:250 http api debug | 

# request:

POST /index/api/openRtpServer

# header:

Accept-Encoding : gzip

Connection : Keep-Alive

Content-Length : 140

Content-Type : application/x-www-form-urlencoded

Host : 192.168.3.111:6080

User-Agent : okhttp/4.10.0

# content:

secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&re_use_port=0&stream_id=34020000001320000205_34020000001310000051&port=0&only_audio=0&tcp_mode=0

# response:

{
    "code" : 0,
    "port" : 50000
}

2024-04-01 17:46:19.090 D [MediaServer.exe] [3640-event poller 1] WebApi.cpp:250 http api debug | 

# request:

POST /index/api/getMediaList

# header:

Accept-Encoding : gzip

Connection : Keep-Alive

Content-Length : 123

Content-Type : application/x-www-form-urlencoded

Host : 192.168.3.111:6080

User-Agent : okhttp/4.10.0

# content:

secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&app=rtp&vhost=__defaultVhost__&stream=34020000001320000205_34020000001310000051

# response:

{
    "code" : 0
}

2024-04-01 17:46:19.090 I [MediaServer.exe] [3640-event poller 1] GB28181Process.cpp:178 onRtpDecode | 34020000001320000205_34020000001310000051 judged to be PS
2024-04-01 17:46:19.091 I [MediaServer.exe] [3640-event poller 1] Decoder.cpp:240 onTrack | got track: PCMA
2024-04-01 17:46:19.091 I [MediaServer.exe] [3640-event poller 1] Decoder.cpp:240 onTrack | got track: H265
2024-04-01 17:46:19.091 I [MediaServer.exe] [3640-event poller 1] Decoder.cpp:159 onStream | add track finished
2024-04-01 17:46:19.102 I [MediaServer.exe] [3640-event poller 1] MediaSink.cpp:28 addTrack | Audio disabled, audio track ignored
2024-04-01 17:46:19.103 I [MediaServer.exe] [3640-event poller 1] RtpProcess.cpp:265 operator () | 34020000001320000205_34020000001310000051(192.168.0.31:40537) 允许RTP推流
2024-04-01 17:46:19.211 D [MediaServer.exe] [3640-event poller 1] MediaSink.cpp:150 emitAllTrackReady | All track ready use 109ms
2024-04-01 17:46:19.213 I [MediaServer.exe] [3640-event poller 1] MediaSource.cpp:501 emitEvent | 媒体注册:fmp4://__defaultVhost__/rtp/34020000001320000205_34020000001310000051
2024-04-01 17:46:19.214 I [MediaServer.exe] [3640-event poller 1] MultiMediaSourceMuxer.cpp:444 onAllTrackReady | stream: rtp://__defaultVhost__/rtp/34020000001320000205_34020000001310000051 , codec info: H265[2304/1296/25] 
2024-04-01 17:46:19.222 I [MediaServer.exe] [3640-event poller 1] MediaSource.cpp:501 emitEvent | 媒体注册:rtmp://__defaultVhost__/rtp/34020000001320000205_34020000001310000051
2024-04-01 17:46:19.224 I [MediaServer.exe] [3640-event poller 1] MediaSource.cpp:501 emitEvent | 媒体注册:rtsp://__defaultVhost__/rtp/34020000001320000205_34020000001310000051
2024-04-01 17:46:19.228 I [MediaServer.exe] [3640-event poller 1] MediaSource.cpp:501 emitEvent | 媒体注册:ts://__defaultVhost__/rtp/34020000001320000205_34020000001310000051
2024-04-01 17:46:19.278 W [MediaServer.exe] [3640-work poller 0] Process.cpp:147 run | start child process fail: no such file or directory
2024-04-01 17:46:19.280 D [MediaServer.exe] [3640-work poller 0] WebApi.cpp:250 http api debug | 

# request:

GET /index/api/getSnap?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&expire_sec=1&url=rtsp%3A%2F%2F127.0.0.1%3A554%2Frtp%2F34020000001320000205_34020000001310000051&timeout_sec=15

# header:

Accept-Encoding : gzip

Connection : Keep-Alive

Host : 192.168.3.111:6080

User-Agent : okhttp/4.10.0

# content:

# response size:47255

2024-04-01 17:46:19.374 W [MediaServer.exe] [3640-event poller 2] HttpSession.cpp:428 operator () | 3-1236(192.168.3.111:51790) flv播放器一般只支持H264和AAC编码,该编码格式可能不被播放器支持:H265
2024-04-01 17:46:19.391 W [MediaServer.exe] [3640-event poller 2] HttpSession.cpp:169 onError | 3-1236(192.168.3.111:51790) FLV/TS/FMP4播放器(__defaultVhost__/rtp/34020000001320000205_34020000001310000051)断开:5(recv close request from client),耗时(s):0
2024-04-01 17:46:19.787 W [MediaServer.exe] [3640-event poller 3] HttpSession.cpp:428 operator () | 4-1236(192.168.3.111:51793) flv播放器一般只支持H264和AAC编码,该编码格式可能不被播放器支持:H265
2024-04-01 17:46:19.787 W [MediaServer.exe] [3640-event poller 3] EventPoller.cpp:201 async_l | take time: 8ms, thread may be overloaded
2024-04-01 17:46:27.178 I [MediaServer.exe] [3640-event poller 1] MediaSource.cpp:501 emitEvent | 媒体注册:hls://__defaultVhost__/rtp/34020000001320000205_34020000001310000051
2024-04-01 17:46:27.187 W [MediaServer.exe] [3640-event poller 3] HttpSession.cpp:169 onError | 4-1236(192.168.3.111:51793) FLV/TS/FMP4播放器(__defaultVhost__/rtp/34020000001320000205_34020000001310000051)断开:5(recv close request from client),耗时(s):7
2024-04-01 17:46:28.032 W [MediaServer.exe] [3640-event poller 1] RtpProcess.cpp:62 ~RtpProcess | 34020000001320000205_34020000001310000051(192.168.0.31:40537) RTP推流器(__defaultVhost__/rtp/34020000001320000205_34020000001310000051)断开,耗时(s):8
2024-04-01 17:46:28.034 I [MediaServer.exe] [3640-event poller 1] MediaSource.cpp:501 emitEvent | 媒体注销:hls://__defaultVhost__/rtp/34020000001320000205_34020000001310000051
2024-04-01 17:46:28.035 I [MediaServer.exe] [3640-event poller 1] MediaSource.cpp:501 emitEvent | 媒体注销:ts://__defaultVhost__/rtp/34020000001320000205_34020000001310000051
2024-04-01 17:46:28.038 I [MediaServer.exe] [3640-event poller 1] MediaSource.cpp:501 emitEvent | 媒体注销:rtsp://__defaultVhost__/rtp/34020000001320000205_34020000001310000051
2024-04-01 17:46:28.040 I [MediaServer.exe] [3640-event poller 1] MediaSource.cpp:501 emitEvent | 媒体注销:rtmp://__defaultVhost__/rtp/34020000001320000205_34020000001310000051
2024-04-01 17:46:28.041 I [MediaServer.exe] [3640-event poller 1] MediaSource.cpp:501 emitEvent | 媒体注销:fmp4://__defaultVhost__/rtp/34020000001320000205_34020000001310000051
2024-04-01 17:46:28.041 I [MediaServer.exe] [3640-event poller 1] Rtsp.cpp:449 operator () | return port to pool:50000-50001
2024-04-01 17:46:28.042 D [MediaServer.exe] [3640-event poller 1] WebApi.cpp:250 http api debug | 

# request:

POST /index/api/closeRtpServer

# header:

Accept-Encoding : gzip

Connection : Keep-Alive

Content-Length : 95

Content-Type : application/x-www-form-urlencoded

Host : 192.168.3.111:6080

User-Agent : okhttp/4.10.0

# content:

secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&stream_id=34020000001320000205_34020000001310000051

# response:

{
    "code" : 0,
    "hit" : 1
}

2024-04-01 17:46:28.045 D [MediaServer.exe] [3640-event poller 1] WebApi.cpp:250 http api debug | 

# request:

POST /index/api/close_streams

# header:

Accept-Encoding : gzip

Connection : Keep-Alive

Content-Length : 131

Content-Type : application/x-www-form-urlencoded

Host : 192.168.3.111:6080

User-Agent : okhttp/4.10.0

# content:

secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&app=rtp&vhost=__defaultVhost__&stream=34020000001320000205_34020000001310000051&force=1

# response:

{
    "code" : 0,
    "count_closed" : 0,
    "count_hit" : 0
}
mengxing2017 commented 6 months ago

这是 GB28181-2022的功能,前提是你的摄像头支持 GB28181-2022,作者有付费版支持完整 GB28181-2022版本的代码

wbkong commented 6 months ago

你好,摄像头应该是支持GB28181-2022,目前单独连摄像头能控制播放的码流。现在有另外几个问题,麻烦解答一下 1、录像机有没GB28181-2022区分的?目前是经过了录像机会导致选择的码流功能不生效 2、付费版的价格是多少? 3、如何购买? 4、能否开发票? 5、购买后的后续更新是否免费?有效期多久? 6、售后服务如何?是否会有专门技术人员答疑?

陪你看雪 @.***

 

------------------ 原始邮件 ------------------ 发件人: "648540858/wvp-GB28181-pro" @.>; 发送时间: 2024年4月2日(星期二) 晚上10:31 @.>; @.**@.>; 主题: Re: [648540858/wvp-GB28181-pro] 技术咨询 使用GB28181连接录像机,播放选择码流不生效 (Issue #1404)

这是 GB28181-2022的功能,前提是你的摄像头支持 GB28181-2022,作者有付费版支持完整 GB28181-2022版本的代码

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

mengxing2017 commented 6 months ago

只能回答你第一个问题,GB28181协议版本号,在平台接入那里会显示版本号,当前市面上的摄像头型号基本是 2016版本,只有最新的型号才强制使用2022版本,其他问题等作者能不能看到你这个issue咯

wbkong commented 6 months ago

哈哈,我还以为你是作者的协助人员呢,谢谢你的解答

陪你看雪 @.***

 

------------------ 原始邮件 ------------------ 发件人: "648540858/wvp-GB28181-pro" @.>; 发送时间: 2024年4月3日(星期三) 上午9:45 @.>; @.**@.>; 主题: Re: [648540858/wvp-GB28181-pro] 技术咨询 使用GB28181连接录像机,播放选择码流不生效 (Issue #1404)

只能回答你第一个问题,GB28181协议版本号,在平台接入那里会显示版本号,当前市面上的摄像头型号基本是 2016版本,只有最新的型号才强制使用2022版本,其他问题等作者能不能看到你这个issue咯

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

648540858 commented 5 months ago

邮件里回复过你,关闭了