ossrs / srs

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
25.9k stars 5.4k forks source link

GB28181: TCP streaming failed and the stream keeps pushing #2217

Closed yushimeng closed 3 years ago

yushimeng commented 3 years ago

Description

Please describe your issue here.

  1. SRS version: 4.0.74
    1. SRS log is as follows:
      [2021-02-26 10:49:34.262][Warn][7500][uk65z339][2] gb28181: client id=34020000002000000007@34020000001320001128 ssrc=0x25f4104, peer(111.206.214.15, 15060), no rtp data 2 in seconds, clean it, wait other port!

Steps to reproduce the bug: Open the configuration file and enable tcp streaming. After some time (around 30 seconds), the rtmp muxer is released due to not receiving any flow. When tracing back, it is found that the on_rtp function is not triggered after the read operation during streaming. The function appears to be fine, but debugging does not reveal where the issue lies. I'm eager to know what caused this behavior.

TRANS_BY_GPT3

yushimeng commented 3 years ago

Thank you for the author's attention, looking forward to the results, yo.

TRANS_BY_GPT3

yinjiaoyuan commented 3 years ago

Please upload more detailed log information, such as whether it uses h264 or h265, the camera brand, and other information.

TRANS_BY_GPT3

iceylm commented 3 years ago

Hello, I have also encountered this phenomenon. When tcp_enable is set to off in the conf file, it works fine. However, when it is set to on, there is no video stream. For Dahua cameras, do we need to configure the video stream to use TCP or UDP on the camera itself? I couldn't find any configuration for it. Logs:

[2021-03-01 20:51:13.294][Trace][9593][470ps0i0][MAIN] SRS/4.0.74(Leo), MIT [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] authors: Winlin,Wenjie,Runner365,John,B.P.Y,Lixin [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] contributors: winlinwinlin@vip.126.com wenjie.zhao740936897@qq.com xiangcheng.liuliuxc0116@foxmail.com naijia.liuyoungcow@youngcow.net alcoholyialcoholyi@qq.com bytemanwangchen2011@gmail.com chad.wangchad.wang.cn@gmail.com suhetaosuhetao@gmail.com Johnnyfengjihu@163.com karthikeyankeyanmca@gmail.com StevenLiulq@chinaffmpeg.org zhengflzhengfl_1989@126.com tufang14breadbean1449@gmail.com allspaceallspace@gmail.com niesongsongnie950@gmail.com rudeb0tnimrod@themanxgroup.tw CallMeNPnp.liamg@gmail.com synotesynote@qq.com lovecatlittlefawn@163.com panda1986542638787@qq.com YueHonghuihongf.yue@hotmail.com ThomasDreibholzdreibh@simula.no JuntaoLiujuntliu@gmail.com RocFangfangpeng1986@gmail.com MakarovYaroslavyaroslav.makarov.97@mail.ru MirkoVelicmvelic@inoxx.net HuiZhang(huzhang2)huzhang2@cisco.com OtterWasimpleotter23@gmail.com walkermi172192667@qq.com haofzfuzhuang.hao@vhall.com ME_Kun_Hanhanvskun@hotmail.com ljx0305ljx0305@gmail.com cenxinweicenshanhe@163.com StarBrilliantm13253@hotmail.com xubinxubin@chnvideo.com intliangyintiliang@gmail.com flowerwrongsysuyangkang@gmail.com YLX568414379@qq.com Jguotaojiang@qq.com Harlanhailiang@gvrcraft.com hankunhankun@bravovcloud.com JonathanBarrattjonathan.barratt@gmail.com KeeganHkeeganwharris@gmail.com StevenLiulingjiujianke@gmail.com liuxc0116liuxc0116@gmail.com ChengdongZhanglmajzcd@sina.com lovacatlovecat@china.sina.com qiang.liqiang.li@verycdn.com.cn HungMingWuu9089000@gmail.com Himerxishizhaohua@qq.com xialixinxlx0625@163.com alphonsetaityh_123@163.com Michael.Mawnpllr@gmail.com lam2003linmin3@yy.com runner365shi.weibd@hotmail.com XiaofengWangwasphin@gmail.com XiaLixinxialx@yuntongxun.com xiaozhihongxiaozhihong8@gmail.com HuyaJohnxiaozhihong@huya.com yanghuiwencainiaodj@qq.com Bepartofyou309554135@qq.com l22312935+lam2003@github xfalconx-falcon@github cghjinxue.cgh@alibaba-inc.com LiPengmozhan.lp@alibaba-inc.com xiaozhihonghondaxiao@tencent.com yajun18yajun18@staff.sina.com.cn liulichuanliulichuan@kuaishou.com yapingcatcaoyapingneu@163.com chenchengbinchenchengbin@yy.com chenhaibochenhaibo@RD-CHB-0476-01 jasongwqjasongwq@gmail.com xialixinxialixin@kanzhun.com yinjiaoyuanyinjiaoyuan@163.com PieerePipihuibin@hotmail.com JesseXijesse.jinjin@wo.cn PieerePi40780488+PieerePi@github ghostsfghost_sf@163.com xbpeng12153243357+xbpeng121@github johzzyhellojinqiang@gmail.com [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] cwd=/root/srs-new/trunk, work_dir=./, build: 2021-02-24 11:14:06, configure: --x86-x64 --with-gb28181, uname: Linux VM-0-11-centos 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux, osx: 0 [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] configure detail: --prefix=/usr/local/srs --hls=on --hds=off --dvr=on --ssl=on --https=on --ssl-1-0=on --ssl-local=off --sys-ssl=off --transcode=on --ingest=on --stat=on --http-callback=on --http-server=on --stream-caster=on --http-api=on --utest=off --cherrypy=on --srt=off --rtc=on --simulator=off --gb28181=on --cxx11=on --cxx14=off --ffmpeg-fit=on --nasm=on --srtp-nasm=on --sendmmsg=off --clean=on --gperf=off --gmc=off --gmd=off --gmp=off --gcp=off --gprof=off --static=off --use-shared-st=off --use-shared-srt=off --log-verbose=off --log-info=off --log-trace=on --gcov=off --debug=off --debug-stats=off --cc=gcc --cxx=g++ --ar=ar --ld=ld --randlib=randlib [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] srs checking config... [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] ips, iface[0] eth0 ipv4 0x11043 172.17.0.11, iface[1] eth0 ipv6 0x11043 fe80::5054:ff:fe3e:a1bb6.953223e-310th0 [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] devices, intranet eth0 172.17.0.11, intranet eth0 fe80::5054:ff:fe3e:a1bb6.953223e-310th0 [2021-03-01 20:51:13.294][Warn][9593][470ps0i0][0] stats network use index=0, ip=172.17.0.11, ifname=eth0 [2021-03-01 20:51:13.294][Warn][9593][470ps0i0][0] stats disk not configed, disk iops disabled. [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] you can check log by: tail -f ./objs/srs.log (@see https://github.com/ossrs/srs/wiki/v1_CN_SrsLog) [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] please check SRS by: ./etc/init.d/srs status [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] features, rch:on, dash:on, hls:on, hds:off, srt:off, hc:on, ha:on, hs:on, hp:on, dvr:on, trans:on, inge:on, stat:on, sc:on [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] SRS on amd64 x86_64, conf:conf/push.gb28181.conf, limit:1000, writev:1024, encoding:little-endian, HZ:100 [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] mw sleep:350ms. mr enabled:on, default:0, sleep:350ms [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] gc:on, pq:30000ms, cscc:[0,16), csa:on, tn:on(may hurts performance), ss:auto(guess by merged write) [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] system default latency(ms): mw(0-350) + mr(0-350) + play-queue(0-30000) [2021-03-01 20:51:13.294][Warn][9593][470ps0i0][0] SRS/4.0.74 is not stable [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] start daemon mode... [2021-03-01 20:51:13.295][Trace][9594][470ps0i0] father process exit [2021-03-01 20:51:13.295][Trace][9593][470ps0i0] grandpa process exit. [2021-03-01 20:51:13.296][Trace][9595][470ps0i0] son(daemon) process running. [2021-03-01 20:51:13.298][Trace][9595][470ps0i0] st_init success, use epoll [2021-03-01 20:51:13.299][Trace][9595][470ps0i0] fingerprint=BF:4C:80:57:7D:E5:7A:5D:D6:C0:04:01:B5:7C:1E:9C:02:FF:31:73:A0:B0:E7:D1:46:3C:3B:37:F1:86:DF:8F [2021-03-01 20:51:13.299][Trace][9595][470ps0i0] RTC server init ok [2021-03-01 20:51:13.300][Trace][9595][470ps0i0] http: root mount to ./objs/nginx/html [2021-03-01 20:51:13.300][Trace][9595][470ps0i0] server main cid=470ps0i0, pid=9595, ppid=1, asprocess=0 [2021-03-01 20:51:13.300][Trace][9595][470ps0i0] write pid=9595 to ./objs/srs.pid success! [2021-03-01 20:51:13.301][Trace][9595][470ps0i0] RTMP listen at tcp://0.0.0.0:1935, fd=8 [2021-03-01 20:51:13.301][Trace][9595][470ps0i0] HTTP-API listen at tcp://0.0.0.0:20985, fd=9 [2021-03-01 20:51:13.301][Trace][9595][470ps0i0] HTTP-Server listen at tcp://0.0.0.0:18080, fd=10 [2021-03-01 20:51:13.302][Trace][9595][470ps0i0] UDP #11 LISTEN at 0.0.0.0:5060, SO_SNDBUF(default=212992, expect=10485760, actual=425984, r0=0), SO_RCVBUF(default=212992, expect=10485760, actual=425984, r0=0) [2021-03-01 20:51:13.302][Trace][9595][470ps0i0] GB28181-SIP over UDP listen at udp://0.0.0.0:5060, fd=11 [2021-03-01 20:51:13.304][Trace][9595][470ps0i0] signal installed, reload=1, reopen=10, fast_quit=15, grace_quit=3 [2021-03-01 20:51:13.304][Trace][9595][470ps0i0] http: api mount /console to ./objs/nginx/html/console [2021-03-01 20:51:13.304][Trace][9595][470ps0i0] rtc listen at udp://0.0.0.0:8000, fd=13 [2021-03-01 20:51:13.304][Trace][9595][470ps0i0] Hybrid cpu=0.00%,0MB [2021-03-01 20:51:13.304][Trace][9595][b5qx3743] GB28181: connection manager run, conns=0 [2021-03-01 20:51:13.304][Trace][9595][13ef1akf] GB28181TCP: connection manager run, conns=0 [2021-03-01 20:51:13.304][Trace][9595][9fxw252z] TCP: connection manager run, conns=0 [2021-03-01 20:51:13.304][Trace][9595][2br315vt] UDP #13 LISTEN at 0.0.0.0:8000, SO_SNDBUF(default=212992, expect=10485760, actual=425984, r0=0), SO_RCVBUF(default=212992, expect=10485760, actual=425984, r0=0) [2021-03-01 20:51:13.304][Trace][9595][kl63907u] RTC: connection manager run, conns=0 [2021-03-01 20:51:13.781][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:51:17.800][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:51:18.327][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB [2021-03-01 20:51:21.822][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:51:23.350][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,1, timer=53,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:51:25.841][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:51:28.375][Trace][9595][470ps0i0] Hybrid cpu=0.33%,12MB, cid=1,1, timer=53,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:51:29.862][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:51:33.397][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:51:38.418][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:51:43.439][Trace][9595][470ps0i0] Hybrid cpu=0.33%,12MB, cid=1,0, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:51:48.460][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:51:53.481][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:51:58.162][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:51:58.503][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:51:58.680][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:51:59.701][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:01.720][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:03.527][Trace][9595][470ps0i0] Hybrid cpu=0.33%,12MB, cid=1,0, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:52:05.740][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:08.556][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:52:09.761][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:13.582][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,1,0,0,0,0,0 [2021-03-01 20:52:13.780][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:17.800][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:18.603][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,1,0,0,0,0,0 [2021-03-01 20:52:21.821][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:23.625][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:52:25.840][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:28.648][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:52:29.861][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:33.674][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:52:38.697][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:52:43.720][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=53,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:52:48.741][Trace][9595][470ps0i0] Hybrid cpu=0.33%,12MB, cid=1,0, timer=53,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:52:50.845][Trace][9595][470ps0i0] sip: unkonw message head Route: content=sip:78978201001320000005@121.4.176.246:5060;lr [2021-03-01 20:52:50.845][Trace][9595][470ps0i0] gb28181: request client id=78978201001320000005 peer(117.176.217.131, 9222) [2021-03-01 20:52:50.845][Trace][9595][470ps0i0] gb28181: request method=REGISTER, uri=sip:34020000002000000001@121.4.176.246:5060, version=SIP/2.0 expires=600 [2021-03-01 20:52:53.763][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,1, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:52:58.181][Trace][9595][470ps0i0] sip: unkonw message head Route: content=sip:78978201001320000005@121.4.176.246:5060;lr [2021-03-01 20:52:58.181][Trace][9595][470ps0i0] gb28181: request client id=78978201001320000005 peer(117.176.217.131, 9222) [2021-03-01 20:52:58.181][Trace][9595][470ps0i0] gb28181: request method=REGISTER, uri=sip:34020000002000000001@121.4.176.246:5060, version=SIP/2.0 expires=600 [2021-03-01 20:52:58.792][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,1, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:52:58.850][Trace][9595][e91a914o] gb28181: sip session=78978201001320000005 peer(117.176.217.131, 9222) status(RegisterOk,AliveOk) duration(0,0) [2021-03-01 20:52:59.850][Trace][9595][e91a914o] gb28181: generate ssrc id=78978201001320000005@78978201001320000005, ssrc=40476677 [2021-03-01 20:52:59.850][Trace][9595][e91a914o] new source, stream_url=/live/78978201001320000005@78978201001320000005 [2021-03-01 20:52:59.850][Trace][9595][e91a914o] new source, stream_url=/live/78978201001320000005@78978201001320000005 [2021-03-01 20:52:59.850][Trace][9595][e91a914o] dvr stream 78978201001320000005@78978201001320000005 to file ./objs/nginx/html/live/78978201001320000005@78978201001320000005.1614603179850.flv [2021-03-01 20:52:59.850][Trace][9595][e91a914o] ignore disabled exec for vhost= [2021-03-01 20:52:59.852][Trace][9595][e91a914o] RTC bridge from RTMP, discard_aac=0, discard_bframe=1, merge_nalus=0 [2021-03-01 20:52:59.852][Trace][9595][e91a914o] gb28181: create new stream channel id:78978201001320000005@78978201001320000005 rtmp url=rtmp://127.0.0.1:1935/live/78978201001320000005@78978201001320000005 [2021-03-01 20:52:59.902][Trace][9595][470ps0i0] gb28181: request client id=78978201001320000005, peer(117.176.217.131, 9222) [2021-03-01 20:52:59.902][Trace][9595][470ps0i0] gb28181: respone method=INVITE, uri=34020000002000000002@3402000000, version=SIP/2.0 [2021-03-01 20:52:59.902][Trace][9595][470ps0i0] gb28181: INVITE response 78978201001320000005 client status=100 [2021-03-01 20:52:59.903][Trace][9595][470ps0i0] gb28181: request client id=78978201001320000005, peer(117.176.217.131, 9222) [2021-03-01 20:52:59.903][Trace][9595][470ps0i0] gb28181: respone method=INVITE, uri=34020000002000000002@3402000000, version=SIP/2.0 [2021-03-01 20:52:59.903][Trace][9595][470ps0i0] gb28181: INVITE response 78978201001320000005 client status=101 [2021-03-01 20:52:59.931][Trace][9595][470ps0i0] gb28181: ssrc in y line is 40476677:269a005 [2021-03-01 20:52:59.931][Trace][9595][470ps0i0] gb28181: request client id=78978201001320000005, peer(117.176.217.131, 9222) [2021-03-01 20:52:59.931][Trace][9595][470ps0i0] gb28181: respone method=INVITE, uri=34020000002000000002@3402000000, version=SIP/2.0 [2021-03-01 20:52:59.931][Trace][9595][470ps0i0] gb28181: INVITE response 78978201001320000005 client status=200 [2021-03-01 20:52:59.931][Trace][9595][470ps0i0] gb28181: device unique id is 78978201001320000005@78978201001320000005 [2021-03-01 20:53:00.024][Trace][9595][099257bm] rtsp: serve 117.176.217.131:9509 [2021-03-01 20:53:00.110][Trace][9595][099257bm] <- GBS SrsGb28181TcpPsRtpProcessor::on_rtp_packet_jitter gb28181: client_id , peer(, 9509) ps rtp packet 94B, age=106808739, vt=2/96, sts=0/9000/0x269a005, paylod=82B [2021-03-01 20:53:00.111][Trace][9595][099257bm] RTP: jitbuffer VerifyAndAllocate:newSize:30000, prevBuffer:0, _buffer:35302592 [2021-03-01 20:53:00.850][Trace][9595][e91a914o] gb28181: 78978201001320000005 clients device=78978201001320000005 send invite code=0 [2021-03-01 20:53:02.166][Warn][9595][5hb56gn4][11] gb28181: client id=78978201001320000005@78978201001320000005 ssrc=0x269a005, peer(117.176.217.131, 9509), no rtp data 2 in seconds, clean it, wait other port! [2021-03-01 20:53:02.196][Warn][9595][5hb56gn4][11] gb28181: client id=78978201001320000005@78978201001320000005 ssrc=0x269a005, peer(117.176.217.131, 9509), no rtp data 2 in seconds, clean it, wait other port! [2021-03-01 20:53:02.227][Warn][9595][5hb56gn4][11] gb28181: client id=78978201001320000005@78978201001320000005 ssrc=0x269a005, peer(117.176.217.131, 9509), no rtp data 2 in seconds, clean it, wait other port! Hello, I have also encountered this issue. When tcp_enable is set to off in the conf file, it works fine, but when it is set to on, there is no video stream. For Dahua cameras, do we need to configure the video stream to use TCP or UDP on the camera itself? I couldn't find any configuration. Logs:

[2021-03-01 20:51:13.294][Trace][9593][470ps0i0][MAIN] SRS/4.0.74(Leo), MIT [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] authors: Winlin,Wenjie,Runner365,John,B.P.Y,Lixin [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] contributors: winlinwinlin@vip.126.com wenjie.zhao740936897@qq.com xiangcheng.liuliuxc0116@foxmail.com naijia.liuyoungcow@youngcow.net alcoholyialcoholyi@qq.com bytemanwangchen2011@gmail.com chad.wangchad.wang.cn@gmail.com suhetaosuhetao@gmail.com Johnnyfengjihu@163.com karthikeyankeyanmca@gmail.com StevenLiulq@chinaffmpeg.org zhengflzhengfl_1989@126.com tufang14breadbean1449@gmail.com allspaceallspace@gmail.com niesongsongnie950@gmail.com rudeb0tnimrod@themanxgroup.tw CallMeNPnp.liamg@gmail.com synotesynote@qq.com lovecatlittlefawn@163.com panda1986542638787@qq.com YueHonghuihongf.yue@hotmail.com ThomasDreibholzdreibh@simula.no JuntaoLiujuntliu@gmail.com RocFangfangpeng1986@gmail.com MakarovYaroslavyaroslav.makarov.97@mail.ru MirkoVelicmvelic@inoxx.net HuiZhang(huzhang2)huzhang2@cisco.com OtterWasimpleotter23@gmail.com walkermi172192667@qq.com haofzfuzhuang.hao@vhall.com ME_Kun_Hanhanvskun@hotmail.com ljx0305ljx0305@gmail.com cenxinweicenshanhe@163.com StarBrilliantm13253@hotmail.com xubinxubin@chnvideo.com intliangyintiliang@gmail.com flowerwrongsysuyangkang@gmail.com YLX568414379@qq.com Jguotaojiang@qq.com Harlanhailiang@gvrcraft.com hankunhankun@bravovcloud.com JonathanBarrattjonathan.barratt@gmail.com KeeganHkeeganwharris@gmail.com StevenLiulingjiujianke@gmail.com liuxc0116liuxc0116@gmail.com ChengdongZhanglmajzcd@sina.com lovacatlovecat@china.sina.com qiang.liqiang.li@verycdn.com.cn HungMingWuu9089000@gmail.com Himerxishizhaohua@qq.com xialixinxlx0625@163.com alphonsetaityh_123@163.com Michael.Mawnpllr@gmail.com lam2003linmin3@yy.com runner365shi.weibd@hotmail.com XiaofengWangwasphin@gmail.com XiaLixinxialx@yuntongxun.com xiaozhihongxiaozhihong8@gmail.com HuyaJohnxiaozhihong@huya.com yanghuiwencainiaodj@qq.com Bepartofyou309554135@qq.com l22312935+lam2003@github xfalconx-falcon@github cghjinxue.cgh@alibaba-inc.com LiPengmozhan.lp@alibaba-inc.com xiaozhihonghondaxiao@tencent.com yajun18yajun18@staff.sina.com.cn liulichuanliulichuan@kuaishou.com yapingcatcaoyapingneu@163.com chenchengbinchenchengbin@yy.com chenhaibochenhaibo@RD-CHB-0476-01 jasongwqjasongwq@gmail.com xialixinxialixin@kanzhun.com yinjiaoyuanyinjiaoyuan@163.com PieerePipihuibin@hotmail.com JesseXijesse.jinjin@wo.cn PieerePi40780488+PieerePi@github ghostsfghost_sf@163.com xbpeng12153243357+xbpeng121@github johzzyhellojinqiang@gmail.com [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] cwd=/root/srs-new/trunk, work_dir=./, build: 2021-02-24 11:14:06, configure: --x86-x64 --with-gb28181, uname: Linux VM-0-11-centos 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux, osx: 0 [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] configure detail: --prefix=/usr/local/srs --hls=on --hds=off --dvr=on --ssl=on --https=on --ssl-1-0=on --ssl-local=off --sys-ssl=off --transcode=on --ingest=on --stat=on --http-callback=on --http-server=on --stream-caster=on --http-api=on --utest=off --cherrypy=on --srt=off --rtc=on --simulator=off --gb28181=on --cxx11=on --cxx14=off --ffmpeg-fit=on --nasm=on --srtp-nasm=on --sendmmsg=off --clean=on --gperf=off --gmc=off --gmd=off --gmp=off --gcp=off --gprof=off --static=off --use-shared-st=off --use-shared-srt=off --log-verbose=off --log-info=off --log-trace=on --gcov=off --debug=off --debug-stats=off --cc=gcc --cxx=g++ --ar=ar --ld=ld --randlib=randlib [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] srs checking config... [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] ips, iface[0] eth0 ipv4 0x11043 172.17.0.11, iface[1] eth0 ipv6 0x11043 fe80::5054:ff:fe3e:a1bb6.953223e-310th0 [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] devices, intranet eth0 172.17.0.11, intranet eth0 fe80::5054:ff:fe3e:a1bb6.953223e-310th0 [2021-03-01 20:51:13.294][Warn][9593][470ps0i0][0] stats network use index=0, ip=172.17.0.11, ifname=eth0 [2021-03-01 20:51:13.294][Warn][9593][470ps0i0][0] stats disk not configed, disk iops disabled. [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] you can check log by: tail -f ./objs/srs.log (@see https://github.com/ossrs/srs/wiki/v1_CN_SrsLog) [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] please check SRS by: ./etc/init.d/srs status [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] features, rch:on, dash:on, hls:on, hds:off, srt:off, hc:on, ha:on, hs:on, hp:on, dvr:on, trans:on, inge:on, stat:on, sc:on [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] SRS on amd64 x86_64, conf:conf/push.gb28181.conf, limit:1000, writev:1024, encoding:little-endian, HZ:100 [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] mw sleep:350ms. mr enabled:on, default:0, sleep:350ms [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] gc:on, pq:30000ms, cscc:[0,16), csa:on, tn:on(may hurts performance), ss:auto(guess by merged write) [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] system default latency(ms): mw(0-350) + mr(0-350) + play-queue(0-30000) [2021-03-01 20:51:13.294][Warn][9593][470ps0i0][0] SRS/4.0.74 is not stable [2021-03-01 20:51:13.294][Trace][9593][470ps0i0] start daemon mode... [2021-03-01 20:51:13.295][Trace][9594][470ps0i0] father process exit [2021-03-01 20:51:13.295][Trace][9593][470ps0i0] grandpa process exit. [2021-03-01 20:51:13.296][Trace][9595][470ps0i0] son(daemon) process running. [2021-03-01 20:51:13.298][Trace][9595][470ps0i0] st_init success, use epoll [2021-03-01 20:51:13.299][Trace][9595][470ps0i0] fingerprint=BF:4C:80:57:7D:E5:7A:5D:D6:C0:04:01:B5:7C:1E:9C:02:FF:31:73:A0:B0:E7:D1:46:3C:3B:37:F1:86:DF:8F [2021-03-01 20:51:13.299][Trace][9595][470ps0i0] RTC server init ok [2021-03-01 20:51:13.300][Trace][9595][470ps0i0] http: root mount to ./objs/nginx/html [2021-03-01 20:51:13.300][Trace][9595][470ps0i0] server main cid=470ps0i0, pid=9595, ppid=1, asprocess=0 [2021-03-01 20:51:13.300][Trace][9595][470ps0i0] write pid=9595 to ./objs/srs.pid success! [2021-03-01 20:51:13.301][Trace][9595][470ps0i0] RTMP listen at tcp://0.0.0.0:1935, fd=8 [2021-03-01 20:51:13.301][Trace][9595][470ps0i0] HTTP-API listen at tcp://0.0.0.0:20985, fd=9 [2021-03-01 20:51:13.301][Trace][9595][470ps0i0] HTTP-Server listen at tcp://0.0.0.0:18080, fd=10 [2021-03-01 20:51:13.302][Trace][9595][470ps0i0] UDP #11 LISTEN at 0.0.0.0:5060, SO_SNDBUF(default=212992, expect=10485760, actual=425984, r0=0), SO_RCVBUF(default=212992, expect=10485760, actual=425984, r0=0) [2021-03-01 20:51:13.302][Trace][9595][470ps0i0] GB28181-SIP over UDP listen at udp://0.0.0.0:5060, fd=11 [2021-03-01 20:51:13.304][Trace][9595][470ps0i0] signal installed, reload=1, reopen=10, fast_quit=15, grace_quit=3 [2021-03-01 20:51:13.304][Trace][9595][470ps0i0] http: api mount /console to ./objs/nginx/html/console [2021-03-01 20:51:13.304][Trace][9595][470ps0i0] rtc listen at udp://0.0.0.0:8000, fd=13 [2021-03-01 20:51:13.304][Trace][9595][470ps0i0] Hybrid cpu=0.00%,0MB [2021-03-01 20:51:13.304][Trace][9595][b5qx3743] GB28181: connection manager run, conns=0 [2021-03-01 20:51:13.304][Trace][9595][13ef1akf] GB28181TCP: connection manager run, conns=0 [2021-03-01 20:51:13.304][Trace][9595][9fxw252z] TCP: connection manager run, conns=0 [2021-03-01 20:51:13.304][Trace][9595][2br315vt] UDP #13 LISTEN at 0.0.0.0:8000, SO_SNDBUF(default=212992, expect=10485760, actual=425984, r0=0), SO_RCVBUF(default=212992, expect=10485760, actual=425984, r0=0) [2021-03-01 20:51:13.304][Trace][9595][kl63907u] RTC: connection manager run, conns=0 [2021-03-01 20:51:13.781][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:51:17.800][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:51:18.327][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB [2021-03-01 20:51:21.822][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:51:23.350][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,1, timer=53,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:51:25.841][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:51:28.375][Trace][9595][470ps0i0] Hybrid cpu=0.33%,12MB, cid=1,1, timer=53,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:51:29.862][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:51:33.397][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:51:38.418][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:51:43.439][Trace][9595][470ps0i0] Hybrid cpu=0.33%,12MB, cid=1,0, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:51:48.460][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:51:53.481][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:51:58.162][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:51:58.503][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:51:58.680][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:51:59.701][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:01.720][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:03.527][Trace][9595][470ps0i0] Hybrid cpu=0.33%,12MB, cid=1,0, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:52:05.740][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:08.556][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:52:09.761][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:13.582][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,1,0,0,0,0,0 [2021-03-01 20:52:13.780][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:17.800][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:18.603][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,1,0,0,0,0,0 [2021-03-01 20:52:21.821][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:23.625][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:52:25.840][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:28.648][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:52:29.861][Trace][9595][470ps0i0] gb28181: 78978201001320000005 client not registered [2021-03-01 20:52:33.674][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:52:38.697][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=52,0,0, clock=0,49,1,0,0,0,0,0,0 [2021-03-01 20:52:43.720][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,0, timer=53,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:52:48.741][Trace][9595][470ps0i0] Hybrid cpu=0.33%,12MB, cid=1,0, timer=53,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:52:50.845][Trace][9595][470ps0i0] sip: unkonw message head Route: content=sip:78978201001320000005@121.4.176.246:5060;lr [2021-03-01 20:52:50.845][Trace][9595][470ps0i0] gb28181: request client id=78978201001320000005 peer(117.176.217.131, 9222) [2021-03-01 20:52:50.845][Trace][9595][470ps0i0] gb28181: request method=REGISTER, uri=sip:34020000002000000001@121.4.176.246:5060, version=SIP/2.0 expires=600 [2021-03-01 20:52:53.763][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,1, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:52:58.181][Trace][9595][470ps0i0] sip: unkonw message head Route: content=sip:78978201001320000005@121.4.176.246:5060;lr [2021-03-01 20:52:58.181][Trace][9595][470ps0i0] gb28181: request client id=78978201001320000005 peer(117.176.217.131, 9222) [2021-03-01 20:52:58.181][Trace][9595][470ps0i0] gb28181: request method=REGISTER, uri=sip:34020000002000000001@121.4.176.246:5060, version=SIP/2.0 expires=600 [2021-03-01 20:52:58.792][Trace][9595][470ps0i0] Hybrid cpu=0.00%,12MB, cid=1,1, timer=52,0,0, clock=0,49,0,0,0,0,0,0,0 [2021-03-01 20:52:58.850][Trace][9595][e91a914o] gb28181: sip session=78978201001320000005 peer(117.176.217.131, 9222) status(RegisterOk,AliveOk) duration(0,0) [2021-03-01 20:52:59.850][Trace][9595][e91a914o] gb28181: generate ssrc id=78978201001320000005@78978201001320000005, ssrc=40476677 [2021-03-01 20:52:59.850][Trace][9595][e91a914o] new source, stream_url=/live/78978201001320000005@78978201001320000005 [2021-03-01 20:52:59.850][Trace][9595][e91a914o] new source, stream_url=/live/78978201001320000005@78978201001320000005 [2021-03-01 20:52:59.850][Trace][9595][e91a914o] dvr stream 78978201001320000005@78978201001320000005 to file ./objs/nginx/html/live/78978201001320000005@78978201001320000005.1614603179850.flv [2021-03-01 20:52:59.850][Trace][9595][e91a914o] ignore disabled exec for vhost= [2021-03-01 20:52:59.852][Trace][9595][e91a914o] RTC bridge from RTMP, discard_aac=0, discard_bframe=1, merge_nalus=0 [2021-03-01 20:52:59.852][Trace][9595][e91a914o] gb28181: create new stream channel id:78978201001320000005@78978201001320000005 rtmp url=rtmp://127.0.0.1:1935/live/78978201001320000005@78978201001320000005 [2021-03-01 20:52:59.902][Trace][9595][470ps0i0] gb28181: request client id=78978201001320000005, peer(117.176.217.131, 9222) [2021-03-01 20:52:59.902][Trace][9595][470ps0i0] gb28181: respone method=INVITE, uri=34020000002000000002@3402000000, version=SIP/2.0 [2021-03-01 20:52:59.902][Trace][9595][470ps0i0] gb28181: INVITE response 78978201001320000005 client status=100 [2021-03-01 20:52:59.903][Trace][9595][470ps0i0] gb28181: request client id=78978201001320000005, peer(117.176.217.131, 9222) [2021-03-01 20:52:59.903][Trace][9595][470ps0i0] gb28181: respone method=INVITE, uri=34020000002000000002@3402000000, version=SIP/2.0 [2021-03-01 20:52:59.903][Trace][9595][470ps0i0] gb28181: INVITE response 78978201001320000005 client status=101 [2021-03-01 20:52:59.931][Trace][9595][470ps0i0] gb28181: ssrc in y line is 40476677:269a005 [2021-03-01 20:52:59.931][Trace][9595][470ps0i0] gb28181: request client id=78978201001320000005, peer(117.176.217.131, 9222) [2021-03-01 20:52:59.931][Trace][9595][470ps0i0] gb28181: respone method=INVITE, uri=34020000002000000002@3402000000, version=SIP/2.0 [2021-03-01 20:52:59.931][Trace][9595][470ps0i0] gb28181: INVITE response 78978201001320000005 client status=200 [2021-03-01 20:52:59.931][Trace][9595][470ps0i0] gb28181: device unique id is 78978201001320000005@78978201001320000005 [2021-03-01 20:53:00.024][Trace][9595][099257bm] rtsp: serve 117.176.217.131:9509 [2021-03-01 20:53:00.110][Trace][9595][099257bm] <- GBS SrsGb28181TcpPsRtpProcessor::on_rtp_packet_jitter gb28181: client_id , peer(, 9509) ps rtp packet 94B, age=106808739, vt=2/96, sts=0/9000/0x269a005, paylod=82B [2021-03-01 20:53:00.111][Trace][9595][099257bm] RTP: jitbuffer VerifyAndAllocate:newSize:30000, prevBuffer:0, _buffer:35302592 [2021-03-01 20:53:00.850][Trace][9595][e91a914o] gb28181: 78978201001320000005 clients device=78978201001320000005 send invite code=0 [2021-03-01 20:53:02.166][Warn][9595][5hb56gn4][11] gb28181: client id=78978201001320000005@78978201001320000005 ssrc=0x269a005, peer(117.176.217.131, 9509), no rtp data 2 in seconds, clean it, wait other port! [2021-03-01 20:53:02.196][Warn][9595][5hb56gn4][11] gb28181: client id=78978201001320000005@78978201001320000005 ssrc=0x269a005, peer(117.176.217.131, 9509), no rtp data 2 in seconds, clean it, wait other port! [2021-03-01 20:53:02.227][Warn][9595][5hb56gn4][11] gb28181: client id=78978201001320000005@78978201001320000005 ssrc=0x269a005, peer(117.176.217.131, 9509), no rtp data 2 in seconds, clean it, wait other port!

TRANS_BY_GPT3

yinjiaoyuan commented 3 years ago

@iceylm I don't have Dahua's cameras on hand right now, I only have Hikvision's cameras. Data stream configuration for TCP or UDP is not necessary on Hikvision cameras. Can you buy Dahua cameras on JD.com? Please let me know the model number.

TRANS_BY_GPT3

iceylm commented 3 years ago

I tried both Dahua and Hikvision last night, and both worked fine with UDP. However, when I switched to TCP, it didn't work. I'll tell you the model when I get home.

TRANS_BY_GPT3

yushimeng commented 3 years ago

@iceylm hi, the camera's tcp/udp setting is the transport protocol at the protocol layer. As long as the invite protocol in the SDP specifies TCP, the camera will transmit the stream using TCP.

TRANS_BY_GPT3

iceylm commented 3 years ago

I think so too. I couldn't find the camera settings, there is no such option. Is your environment working fine using TCP?

TRANS_BY_GPT3

yushimeng commented 3 years ago

// rtp length uint32_t length = 0; length = (0x0000ff00 & (leftData[0] << 8)) | (leftData[1]);

iceylm commented 3 years ago

@mico-yu Great master, are you saying there is a bug in the length check in SrsGb28181Conn::do_cycle()? Could you please share the modified code of this function so that I can learn from it?

TRANS_BY_GPT3

iceylm commented 3 years ago

@yinjiaoyuan
DaHua DH-IPC-HFW1025B Hikvision DS-2CD3T35-I5 The SRS is deployed on Tencent Cloud, and neither of the two cameras can play in TCP mode, but they are both registered online.

TRANS_BY_GPT3

yinjiaoyuan commented 3 years ago

@iceylm, Is Tencent Cloud server TCP port 9000 opened? I suggest trying to open all the ports or set up a local virtual machine to disable the firewall and test it.

TRANS_BY_GPT3

yushimeng commented 3 years ago

This is not a network issue, I have tested it. It is after receiving the stream for a period of time that the memory of mbuffer gets corrupted, and the two bytes for the length of TCP become 14xx, but the following is a very short RTP packet, so the length is incorrect for the next packet.

---Original Email--- From: "yinjiaoyuan"<notifications@github.com> Sent: Friday, March 5, 2021, 11:01 PM To: "ossrs/srs"<srs@noreply.github.com>; Cc: "Mention"<mention@noreply.github.com>;"mico-yu"<598376883@qq.com>; Subject: Re: [ossrs/srs] GB28181: failed to receive TCP stream (#2217)

Hey @iceylm, is the TCP port 9000 on the Tencent Cloud server open? I suggest trying to open all ports and test again, or you can set up a virtual machine locally and disable the firewall to test.

- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

TRANS_BY_GPT3

iceylm commented 3 years ago

@yinjiaoyuan All ports are open.

TRANS_BY_GPT3

limjoe commented 3 years ago

I encountered this problem too. After specifying TCP as the transmission method in the SDP carried by the Invite protocol, it shows that the channel creation was successful, but immediately displays "no RTP data 2 in seconds, clean it, wait for other port!" Then it directly releases this channel.

However, when I captured and observed the network traffic, the device was still streaming to this TCP port.

TRANS_BY_GPT3

limjoe commented 3 years ago

@iceylm, have you solved it?

TRANS_BY_GPT3

iceylm commented 3 years ago

Roughly adjusted, there should be a bug in SrsGb28181Conn::do_cycle(), which has not been fixed yet.

TRANS_BY_GPT3

limjoe commented 3 years ago

Hello @xialixin, we have all encountered this issue with TCP streaming here. Could you please take a look when you have some time? Thank you, thank you.

TRANS_BY_GPT3

limjoe commented 3 years ago

Upon reviewing the logs, it was observed that multiple 'new stream channels' will be created, but with different IDs. The following logs are from the start of streaming until it was interrupted. Currently, it is confirmed that only one device is streaming.

[2021-04-06 07:03:24.956][Trace][10][m5hia13t] <- GBS SrsGb28181TcpPsRtpProcessor::on_rtp_packet_jitter gb28181: client_id , peer(, 41434) ps rtp packet 94B, age=-614636107, vt=2/96, sts=1/3600/0x3725af9a, paylod=82B
[2021-04-06 07:03:24.956][Trace][10][m5hia13t] gb28181: create new stream channel id:chid925216666 rtmp url=rtmp://127.0.0.1:1935gb28181/925216666
[2021-04-06 07:03:25.048][Trace][10][s585lr13] gb28181: ps map video es_type=h264(1b), es_id=e0, es_info_length=12
[2021-04-06 07:03:25.048][Trace][10][s585lr13] gb28181: ps map audio es_type=g711(90), es_id=c0, es_info_length=0
[2021-04-06 07:03:25.048][Trace][10][s585lr13] gb28181: rtmp connect url=rtmp://127.0.0.1:1935/gb28181/925216666
[2021-04-06 07:03:25.089][Trace][10][s990g468] connect app, tcUrl=rtmp://127.0.0.1/gb28181, pageUrl=, swfUrl=, schema=rtmp, vhost=127.0.0.1, port=1935, app=gb28181, args=(obj)
[2021-04-06 07:03:25.130][Trace][10][s990g468] client identified, type=flash-publish, vhost=127.0.0.1, app=gb28181, stream=925216666, param=?vhost=127.0.0.1, duration=0ms
[2021-04-06 07:03:25.130][Trace][10][s990g468] connected stream, tcUrl=rtmp://127.0.0.1/gb28181, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=1935, app=gb28181, stream=925216666, param=?vhost=127.0.0.1, args=(obj)
[2021-04-06 07:03:25.130][Trace][10][s990g468] source url=/gb28181/925216666, ip=127.0.0.1, cache=1, is_edge=0, source_id=/9834171s
[2021-04-06 07:03:28.894][Trace][10][m5hia13t] gb28181: create new stream channel id:chid1076093416 rtmp url=rtmp://127.0.0.1:1935/gb28181/1076093416
[2021-04-06 07:03:28.894][Trace][10][m5hia13t] gb28181: create new stream channel id:chid966464458 rtmp url=rtmp://127.0.0.1:1935gb28181/966464458
[2021-04-06 07:03:30.867][Warn][10][s585lr13][11] gb28181: client id=chid925216666 ssrc=0x3725af9a, peer(10.121.192.0, 41434), no rtp data 2 in seconds, clean it, wait other port!
[2021-04-06 07:03:30.897][Warn][10][04364533][11] gb28181: client id=chid966464458 ssrc=0x399b13ca, peer(10.121.192.0, 41434), no rtp data 2 in seconds, clean it, wait other port!
[2021-04-06 07:03:30.897][Warn][10][311877ro][11] gb28181: client id=chid1076093416 ssrc=0x4023e1e8, peer(10.121.192.0, 41434), no rtp data 2 in seconds, clean it, wait other port!
[2021-04-06 07:03:33.872][Warn][10][s585lr13][11] gb28181: client id=chid925216666 RTMP connection is about to time out without receiving any data
[2021-04-06 07:03:42.959][Trace][10][s585lr13] gb28181: client id=chid925216666,  ssrc=0x3725af9a, peer(, 0), rtmp muxer is alive
[2021-04-06 07:03:58.851][Trace][10][s585lr13] gb28181: client id=chid925216666, stream idle timeout, stop!!!
[2021-04-06 07:03:58.851][Trace][10][s585lr13] gb28181: client id=chid925216666 rtmp muxer is remove
[2021-04-06 07:03:58.882][Trace][10][311877ro] gb28181: client id=chid1076093416,  ssrc=0x4023e1e8, peer(, 0), rtmp muxer is alive
[2021-04-06 07:03:58.913][Trace][10][311877ro] gb28181: client id=chid1076093416, stream idle timeout, stop!!!
[2021-04-06 07:03:58.913][Trace][10][311877ro] gb28181: client id=chid1076093416 rtmp muxer is remove
[2021-04-06 07:03:58.913][Trace][10][04364533] gb28181: client id=chid966464458, stream idle timeout, stop!!!
[2021-04-06 07:03:58.913][Trace][10][04364533] gb28181: client id=chid966464458 rtmp muxer is remove
[2021-04-06 07:03:59.320][Trace][10][659g8k20] hls cycle to dispose hls /gb28181/925216666, timeout=30000000ms
[2021-04-06 07:03:59.321][Trace][10][659g8k20] gracefully dispose hls /gb28181/925216666

TRANS_BY_GPT3

limjoe commented 3 years ago

I should figure out what the problem is. It may be caused by setting the streaming bitrate too high. When the failure occurs, the upper limit of the bitrate is set to be 4096 (Kb/S).

Now that I have adjusted it to the minimum bitrate of 1972 (Kb/S), this problem does not occur.

TRANS_BY_GPT3

anywaygreetagain commented 3 years ago

I should figure out what problem caused the issue. It may be due to the high streaming bitrate settings. When the failure occurred, the bitrate limit was set to 4096 (Kb/S).

Now, after adjusting to the minimum bitrate of 1972 (Kb/S), this problem won't occur.

Can you please let me know which parameter is used to adjust the minimum bitrate?

TRANS_BY_GPT3

ZhouMin216 commented 3 years ago

This is not a network problem, I have tested it. After a period of time receiving the stream, the memory of mbuffer gets corrupted, and the two bytes indicating the length of the TCP become 14xx, but then there is a very short RTP packet afterwards, so the length is incorrect for the next packet. ... ---Original email--- From: "yinjiaoyuan"notifications@github.com Sent: Friday, March 5, 2021 11:01 PM To: "ossrs/srs"srs@noreply.github.com; Cc: "Mention"mention@noreply.github.com;"mico-yu"598376883@qq.com Subject: Re: [ossrs/srs] GB28181: tcp接流失败 (#2217) @iceylm Is the Tencent Cloud server's TCP port 9000 open? It is recommended to try opening all ports, or set up a virtual machine locally and disable the firewall to test. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Hello, have you resolved this issue? Can you share the solution with me?

TRANS_BY_GPT3

duiniuluantanqin commented 3 years ago

Take a look at the configuration on the camera:

  1. Are you using the 2011 version or the 2016 version?
  2. Is the transmission protocol TCP or UDP?

Some cameras may not have these 2 configuration options at all.

TRANS_BY_GPT3

Cherisher commented 3 years ago

Based on my experience in device integration, there are several main situations:

  1. The device does not support TCP streaming mode, mainly depends on SDP negotiation (some small factory devices may not support it, but still respond as support).
  2. The device fails to establish a TCP connection (when trying 100 times to establish a TCP connection, if it fails, INVITE will not return 200 OK).

TRANS_BY_GPT3

duiniuluantanqin commented 3 years ago

@yinjiaoyuan Dahua DH-IPC-HFW1025B Hikvision DS-2CD3T35-I5 SRS deployed on Tencent Cloud, both cameras cannot play videos using TCP, but are registered online.

Can it be reproduced consistently?

TRANS_BY_GPT3

ZhouMin216 commented 3 years ago

@yinjiaoyuan Dahua DH-IPC-HFW1025B Hikvision DS-2CD3T35-I5 SRS is deployed on Tencent Cloud. Both cameras cannot play using TCP method and are registered online.

Can it reproduce the issue every time?

The situation on my side is: when the device is newly registered, it can use TCP streaming normally. However, after a few hours (the duration is not fixed), SRS reports "stream idle timeout". But when I capture packets, I can see that the TCP stream is still being pushed.

TRANS_BY_GPT3

winlinvip commented 3 years ago

Fixed by PR https://github.com/ossrs/srs/pull/2378