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

RTC: fix rtc publisher pli cid #3318

Merged
merged 5 commits into from
Jan 19, 2023
Merged

Conversation

xiaozhihong
Copy link
Collaborator

RTC publisher cycle request PLI, use correct context id.

@xiaozhihong xiaozhihong linked an issue Dec 15, 2022 that may be closed by this pull request
@winlinvip winlinvip force-pushed the 5.0release branch 22 times, most recently from 623e02f to 7bdb727 Compare December 31, 2022 11:37
@xiaozhihong xiaozhihong deleted the bugfix/rtc-pli-cid branch January 16, 2023 12:36
@xiaozhihong xiaozhihong restored the bugfix/rtc-pli-cid branch January 16, 2023 12:38
@xiaozhihong xiaozhihong reopened this Jan 17, 2023
winlinvip
winlinvip previously approved these changes Jan 17, 2023
@winlinvip winlinvip changed the base branch from 5.0release to develop January 17, 2023 13:42
@winlinvip
Copy link
Member

winlinvip commented Jan 18, 2023

Check by WebRTC publish and play:

grep 'Need PLI' t.log
[2023-01-18 09:28:06.769][INFO][22999][i3oz708r] RTC: Need PLI ssrc=2778412766, play=[i3oz708r], publish=[978q64hp], count=1/1

grep i3oz708r t.log |more
[2023-01-18 09:28:06.757][INFO][22999][i3oz708r] HTTP #0 127.0.0.1:54772 POST http://localhost:1985/rtc/v1/play/, content-length=6945
[2023-01-18 09:28:06.757][INFO][22999][i3oz708r] RTC play webrtc://localhost/live/livestream, api=http://localhost:1985/rtc/v1/play/, tid=8720ddb, clientip=127.0.0.1, app=live, stream=livestream, offer=6387B, eip=, codec=, srtp=, dtls=
[2023-01-18 09:28:06.758][INFO][22999][i3oz708r] ignore attribute=, value=
[2023-01-18 09:28:06.760][INFO][22999][i3oz708r] RTC player nack=1, nnc=1
[2023-01-18 09:28:06.760][INFO][22999][i3oz708r] RTC connection player gcc=3
[2023-01-18 09:28:06.760][INFO][22999][i3oz708r] RTC: Init tracks {track: 03bd982c-a376-426b-bbc8-f21c394028bf, is_active: 0=>1},{track: 0ca3a4fb-c0c1-4efa-b1eb-d3b50ab83066, is_active: 0=>1}, ok
[2023-01-18 09:28:06.760][INFO][22999][i3oz708r] Best matched ip=172.20.10.3, ifname=en6
[2023-01-18 09:28:06.760][INFO][22999][i3oz708r] RTC: Use candidates 172.20.10.3, protocol=udp
[2023-01-18 09:28:06.761][INFO][22999][i3oz708r] RTC init session, user=1428ym3r:CAyM, url=/live/livestream, encrypt=1/1, DTLS(role=passive, version=auto), timeout=30000ms, nack=1

grep 978q64hp t.log |more
[2023-01-18 09:28:02.684][INFO][22999][978q64hp] HTTP #0 127.0.0.1:54744 POST http://localhost:1985/rtc/v1/publish/, content-length=6039
[2023-01-18 09:28:02.685][INFO][22999][978q64hp] RTC publish webrtc://localhost/live/livestream, api=http://localhost:1985/rtc/v1/publish/, tid=3cd128e, clientip=127.0.0.1, app=live, stream=livestream, offer=5558B, eip=, codec=
[2023-01-18 09:28:02.685][INFO][22999][978q64hp] ignore attribute=, value=
[2023-01-18 09:28:02.687][INFO][22999][978q64hp] RTC publisher nack=1, nnc=1, pt-drop=0, twcc=1/3
[2023-01-18 09:28:02.688][INFO][22999][978q64hp] RTC: Init tracks {track: 03bd982c-a376-426b-bbc8-f21c394028bf, is_active: 0=>1},{track: 0ca3a4fb-c0c1-4efa-b1eb-d3b50ab83066, is_active: 0=>1}, ok
[2023-01-18 09:28:02.688][INFO][22999][978q64hp] Best matched ip=172.20.10.3, ifname=en6
[2023-01-18 09:28:02.688][INFO][22999][978q64hp] RTC: Use candidates 172.20.10.3, protocol=udp
[2023-01-18 09:28:02.689][INFO][22999][978q64hp] RTC init session, user=06tt9fw6:qJXA, url=/live/livestream, encrypt=1/1, DTLS(role=passive, version=auto), timeout=30000ms, nack=1

@winlinvip
Copy link
Member

winlinvip commented Jan 18, 2023

Check by

  1. Publish by RTMP.
  2. Play by WebRTC.
  3. Publish by WebRTC.
  4. Play by WebRTC.
grep 'Need PLI' t.log
[2023-01-18 09:31:33.018][INFO][22999][4573858y] RTC: Need PLI ssrc=694299555, play=[3192x165], publish=[3192x165], count=1/1

grep 3192x165 t.log |more
[2023-01-18 09:31:29.275][INFO][22999][3192x165] HTTP #0 127.0.0.1:55978 POST http://localhost:1985/rtc/v1/publish/, content-length=6031
[2023-01-18 09:31:29.276][INFO][22999][3192x165] RTC publish webrtc://localhost/live/livestream, api=http://localhost:1985/rtc/v1/publish/, tid=5e44f86, clientip=127.0.0.1, app=live, stream=livestream, offer=5550B, eip=, codec=
[2023-01-18 09:31:29.276][INFO][22999][3192x165] ignore attribute=, value=
[2023-01-18 09:31:29.278][INFO][22999][3192x165] RTC publisher nack=1, nnc=1, pt-drop=0, twcc=1/3
[2023-01-18 09:31:29.279][INFO][22999][3192x165] RTC: Init tracks {track: f450bb34-1711-44e9-9f8f-9287551de27d, is_active: 0=>1},{track: 90e9f082-a5d1-4d97-9676-bc73abfeeca6, is_active: 0=>1}, ok
[2023-01-18 09:31:29.279][INFO][22999][3192x165] Best matched ip=172.20.10.3, ifname=en6
[2023-01-18 09:31:29.279][INFO][22999][3192x165] RTC: Use candidates 172.20.10.3, protocol=udp
[2023-01-18 09:31:29.280][INFO][22999][3192x165] RTC init session, user=49n59fvh:/RNT, url=/live/livestream, encrypt=1/1, DTLS(role=passive, version=auto), timeout=30000ms, nack=1

After RTC2RTMP, the bridge initiates a PLI request, causing both play and publish to be the same.

This confusion is too significant. Can we use the bridge's CID for play? Also, the bridge for RTC2RTMP does not have any logs. It would be helpful to add a log to identify the context of this issue.

TRANS_BY_GPT3

@winlinvip winlinvip merged commit 7922057 into ossrs:develop Jan 19, 2023
winlinvip added a commit that referenced this pull request Jan 19, 2023
* RTC: fix rtc publisher pli cid
* RTC: log bridge request keyframe
* Update release v6.0.19 v5.0.138

PICK 7922057

Co-authored-by: Winlin <winlin@vip.126.com>
Co-authored-by: ChenGH <chengh_math@126.com>
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 29, 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 this pull request may close these issues.

WebRTC: Reqeust PLI invalid play cid.
3 participants