Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRT: Failed to callback hooks during streaming. #2945

Closed
winlinvip opened this issue Mar 4, 2022 · 5 comments
Closed

SRT: Failed to callback hooks during streaming. #2945

winlinvip opened this issue Mar 4, 2022 · 5 comments
Assignees
Labels
TransByAI Translated by AI/GPT.
Milestone

Comments

@winlinvip
Copy link
Member

winlinvip commented Mar 4, 2022

Enable SRT and hooks, error log as follows:

docker logs -f srs-server|grep 139ng145
03:33:29.679184/srs*E:SRT.d: SND-DROPPED 4 packets - lost delaying for 1022ms
03:35:23.059938/SRT:RcvQ:worker*E:SRT.c: IPE: ACK node overwritten when acknowledging 1162 (ack extracted: 1004308388)
03:36:52.965435/SRT:RcvQ:worker*E:SRT.c: IPE: ACK node overwritten when acknowledging 5908 (ack extracted: 1004325252)
03:37:52.910634/SRT:RcvQ:worker*E:SRT.c: IPE: ACK node overwritten when acknowledging 9105 (ack extracted: 1004336704)
03:38:22.886780/SRT:RcvQ:worker*E:SRT.c: IPE: ACK node overwritten when acknowledging 10711 (ack extracted: 1004342323)
[2022-03-04 03:43:20.303][Trace][1][139ng145] RTMP client ip=127.0.0.1:48970, fd=15
[2022-03-04 03:43:20.305][Trace][1][139ng145] complex handshake success
[2022-03-04 03:43:20.305][Trace][1][139ng145] connect app, tcUrl=rtmp://127.0.0.1/live, pageUrl=, swfUrl=, schema=rtmp, vhost=127.0.0.1, port=1935, app=live, args=(obj)
[2022-03-04 03:43:20.305][Trace][1][139ng145] edge-srs ip=172.17.0.4, version=4.0.241, pid=1, id=0
[2022-03-04 03:43:20.305][Trace][1][139ng145] protocol in.buffer=0, in.ack=0, out.ack=0, in.chunk=128, out.chunk=128
[2022-03-04 03:43:20.307][Trace][1][139ng145] client identified, type=flash-publish, vhost=127.0.0.1, app=live, stream=livestream, param=?secret=d6d2be37&vhost=127.0.0.1, duration=0ms
[2022-03-04 03:43:20.324][Trace][1][139ng145] http: on_connect ok, client_id=139ng145, url=http://mgmt.srs.local:2022/terraform/v1/hooks/srs/verify, request={"server_id":"vid-1odw09d","action":"on_connect","client_id":"139ng145","ip":"127.0.0.1","vhost":"__defaultVhost__","app":"live","stream":"livestream","param":"?secret=d6d2be37&vhost=127.0.0.1","tcUrl":"rtmp://127.0.0.1/live","pageUrl":""}, response={"code":0}
[2022-03-04 03:43:20.325][Trace][1][139ng145] connected stream, tcUrl=rtmp://127.0.0.1/live, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=1935, app=live, stream=livestream, param=?secret=d6d2be37&vhost=127.0.0.1, args=(obj)
[2022-03-04 03:43:20.325][Trace][1][139ng145] source url=/live/livestream, ip=127.0.0.1, cache=1, is_edge=0, source_id=/h03lh218
[2022-03-04 03:43:20.335][Trace][1][139ng145] http: on_publish ok, client_id=139ng145, url=http://mgmt.srs.local:2022/terraform/v1/hooks/srs/verify, request={"server_id":"vid-1odw09d","action":"on_publish","client_id":"139ng145","ip":"127.0.0.1","vhost":"__defaultVhost__","app":"live","tcUrl":"rtmp://127.0.0.1/live","stream":"livestream","param":"?secret=d6d2be37&vhost=127.0.0.1"}, response={"code":0}
[2022-03-04 03:43:20.336][Trace][1][139ng145] RTC bridge from RTMP, rtmp2rtc=1, keep_bframe=0, merge_nalus=0
[2022-03-04 03:43:20.341][Trace][1][139ng145] hls: win=60000ms, frag=10000ms, prefix=, path=./objs/nginx/html, m3u8=[app]/[stream].m3u8, ts=[app]/[stream]-[seq].ts, aof=2.00, floor=0, clean=1, waitk=1, dispose=0ms, dts_directly=1
[2022-03-04 03:43:20.341][Trace][1][139ng145] ignore disabled exec for vhost=__defaultVhost__
[2022-03-04 03:43:20.341][Trace][1][139ng145] start publish mr=0/350, p1stpt=20000, pnt=5000, tcp_nodelay=0
[2022-03-04 03:43:20.834][Trace][1][139ng145] 4B audio sh, codec(10, profile=LC, 2channels, 0kbps, 48000HZ), flv(16bits, 2channels, 44100HZ)
[2022-03-04 03:43:20.838][Trace][1][139ng145] 44B video sh,  codec(7, profile=Main, level=3.1, 1280x720, 0kbps, 0.0fps, 0.0s)
[2022-03-04 03:43:21.105][Trace][1][139ng145] -> HLS time=652477103ms, sno=15, ts=livestream-14.ts, dur=8ms, dva=0p
[2022-03-04 03:43:31.013][Trace][1][139ng145] -> HLS time=662620958ms, sno=15, ts=livestream-14.ts, dur=7382ms, dva=0p
[2022-03-04 03:43:40.356][Trace][1][139ng145] <- CPB time=0, okbps=1,0,0, ikbps=1162,0,0, mr=0/350, p1stpt=20000, pnt=5000
[2022-03-04 03:43:41.028][Trace][1][139ng145] -> HLS time=672651231ms, sno=16, ts=livestream-15.ts, dur=5372ms, dva=0p
[2022-03-04 03:43:45.449][Trace][1][139ng145] <- CPB time=19816087, okbps=1,0,0, ikbps=1175,0,0, mr=0/350, p1stpt=20000, pnt=5000
[2022-03-04 03:43:51.249][Trace][1][139ng145] -> HLS time=682869366ms, sno=17, ts=livestream-16.ts, dur=400ms, dva=0p
[2022-03-04 03:44:01.112][Trace][1][139ng145] <- CPB time=35470534, okbps=0,0,0, ikbps=1111,1120,0, mr=0/350, p1stpt=20000, pnt=5000
[2022-03-04 03:44:01.391][Trace][1][139ng145] -> HLS time=693037553ms, sno=17, ts=livestream-16.ts, dur=7240ms, dva=0p
[2022-03-04 03:44:04.550][Warn][1][139ng145][62] ignore task failed code=1018 : callback on_hls http://mgmt.srs.local:2022/terraform/v1/hooks/srs/hls : http: post http://mgmt.srs.local:2022/terraform/v1/hooks/srs/hls with {"server_id":"vid-1odw09d","action":"on_hls","client_id":"139ng145","ip":"127.0.0.1","vhost":"__defaultVhost__","app":"live","stream":"livestream","param":"?secret=d6d2be37&vhost=127.0.0.1","duration":10.01,"cwd":"/usr/local/srs","file":"./objs/nginx/html/live/livestream-14.ts","url":"live/livestream-14.ts","m3u8":"./objs/nginx/html/live/livestream.m3u8","m3u8_url":"live/livestream.m3u8","seq_no":14}, status=0, res= : http: client post : http: connect server : http: tcp connect http mgmt.srs.local:2022 to=30000ms, rto=30000ms : tcp: connect mgmt.srs.local:2022 to=30000ms : connect to mgmt.srs.local:2022
thread [1][139ng145]: call() [src/app/srs_app_hls.cpp:122][errno=62]
thread [1][139ng145]: on_hls() [src/app/srs_app_http_hooks.cpp:351][errno=62]
thread [1][139ng145]: do_post() [src/app/srs_app_http_hooks.cpp:505][errno=62]
thread [1][139ng145]: post() [src/protocol/srs_service_http_client.cpp:322][errno=62]
thread [1][139ng145]: connect() [src/protocol/srs_service_http_client.cpp:447][errno=62]
thread [1][139ng145]: connect() [src/protocol/srs_service_st.cpp:642][errno=62]
thread [1][139ng145]: srs_tcp_connect() [src/protocol/srs_service_st.cpp:193][errno=62]
03:44:22.508279/SRT:RcvQ:worker*E:SRT.c: IPE: ACK node overwritten when acknowledging 3144 (ack extracted: 748914324)

This will result in the inability to record, as recording relies on HLS callbacks triggering.

TRANS_BY_GPT3

@winlinvip winlinvip assigned winlinvip and runner365 and unassigned winlinvip Mar 4, 2022
@winlinvip winlinvip added this to the 4.0 milestone Mar 4, 2022
@winlinvip
Copy link
Member Author

winlinvip commented Mar 4, 2022

After checking, the business backend did not receive the callback, so it should be that the callback was not initiated.

TRANS_BY_GPT3

@zhouxiaojun2008
Copy link
Contributor

zhouxiaojun2008 commented Mar 4, 2022

This seems to have no problem with the flow, but the callback function srs_tcp_connect is throwing an error.

TRANS_BY_GPT3

@winlinvip
Copy link
Member Author

winlinvip commented Mar 5, 2022

It has nothing to do with the flow, but it caused a timeout, which means the hooks were not called.

TRANS_BY_GPT3

@fanwendian
Copy link

fanwendian commented Apr 8, 2022

When I trigger the hooks for HLS here, I also encountered it, but not very frequently. It will cause the recording to lose TS files.

[2022-04-08 15:22:45.731][Warn][74296][533c88o0][4] ignore task failed code=1018 : callback on_hls http://127.0.0.1:5811/liveservice-transport/srs/api/hls : http: post http://127.0.0.1:5811/liveservice-transport/srs/api/hls with {"server_id":"vid-5hy2245","action":"on_hls","client_id":"533c88o0","ip":"192.168.0.1","vhost":"dvr.com","app":"AN185323544007323MR","stream":"lr7057756096120146869343411012","param":"?nvhost=dvr.com&auth_key=86400-1649402406-1-cd37bbeee4af7c20e143abdafbd82c52","duration":12.26,"cwd":"/data/home/push/nvsrs","file":"./objs/nginx/html/AN185323544007323MR/lr7057756096120146869343411012-21.ts","url":"AN185323544007323MR/lr7057756096120146869343411012-21.ts","m3u8":"./objs/nginx/html/AN185323544007323MR/lr7057756096120146869343411012.m3u8","m3u8_url":"AN185323544007323MR/lr7057756096120146869343411012.m3u8","seq_no":21}, status=200, res= : http: client post : http: connect server : http: tcp connect http 127.0.0.1:5811 to=30000ms, rto=30000ms : tcp: connect 127.0.0.1:5811 to=30000ms : connect to 127.0.0.1:5811

TRANS_BY_GPT3

@xiaozhihong xiaozhihong linked a pull request Apr 15, 2022 that will close this issue
@winlinvip winlinvip modified the milestones: 4.0, 5.0 Dec 9, 2022
@winlinvip
Copy link
Member Author

Fixed in SRS 5.0

@winlinvip winlinvip changed the title SRT:推流时hooks回调失败 SRT: Failed to callback hooks during streaming. Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants