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 NACK negotiation bug for Firefox. #2373

Merged
merged 1 commit into from
Jul 24, 2021

Conversation

duiniuluantanqin
Copy link
Member

@duiniuluantanqin duiniuluantanqin commented May 24, 2021

Reason

  1. The answer sdp in SRS reply does not have the rtcp-fb nack field.
  2. Chrome enables nack by default, so even if SRS's answer does not enable NACK, it is not a problem.
  3. Firefox disables nack by default, so if SRS's answer does not enable NACK, it will cause packet loss and stuttering.

Conclusion

During network jitter, Firefox does not send nack, resulting in video stuttering.

Solution

Adding the rtcp-fb nack field is equivalent to manually enabling Firefox's nack function, which resolves stuttering caused by packet loss.

@see #2371


TRANS_BY_GPT3

@duiniuluantanqin duiniuluantanqin changed the title explicitly enable nack, for firefox explicitly enable nack, for firefox. //@ see https://github.com/ossrs/srs/issues/2371 May 24, 2021
@duiniuluantanqin duiniuluantanqin changed the title explicitly enable nack, for firefox. //@ see https://github.com/ossrs/srs/issues/2371 explicitly enable nack, for firefox. // @see https://github.com/ossrs/srs/issues/2371 May 24, 2021
@duiniuluantanqin duiniuluantanqin changed the title explicitly enable nack, for firefox. // @see https://github.com/ossrs/srs/issues/2371 explicitly enable nack, for firefox May 24, 2021
@winlinvip
Copy link
Member

winlinvip commented May 28, 2021

I confirmed that this is indeed a bug and can be reproduced.

I need to supplement regression testing to prevent similar issues from occurring again in the future.

TRANS_BY_GPT3

@winlinvip winlinvip changed the title explicitly enable nack, for firefox RTC: Fix NACK negotiation bug for Firefox. May 28, 2021
@winlinvip
Copy link
Member

winlinvip commented Jun 30, 2021

Scenarios to be added for regression testing:

  1. If there is a nack in the client's offer and the SRS configuration enables nack, then the answer must have a nack.
  2. If there is no nack in the client's offer or the SRS configuration disables nack, then the answer must not have a nack.

TRANS_BY_GPT3

@winlinvip winlinvip merged commit fb73d42 into ossrs:develop Jul 24, 2021
winlinvip pushed a commit to winlinvip/srs that referenced this pull request Jul 24, 2021
winlinvip added a commit that referenced this pull request Jul 24, 2021
* explicitly enable nack, for firefox (#2373)

* For #2371: Add regression test for SDP nack

1. Refine API to change defaule decodes.
2. Add test for publish SDP nack.
3. Add test for play SDP nack.

Co-authored-by: Haibo Chen <495810242@qq.com>
zhouxiaojun2008 added a commit to zhouxiaojun2008/srs that referenced this pull request Sep 18, 2022
@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
2 participants