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

WebRTC: playback hanging and corrupted if slice-max-size x264 parameter larger than DTLS MTU #2415

Closed
rajkosto opened this issue Jun 16, 2021 · 2 comments · Fixed by #2652
Closed
Assignees
Labels
TransByAI Translated by AI/GPT. WebRTC WebRTC, RTC2RTMP or RTMP2RTC.
Milestone

Comments

@rajkosto
Copy link

srs version: 4.0-release branch commit 4e93696 15.jun.2021
description: i am sending RTMP stream to srs using OBS and playing back with webrtc player, playback hangs every other keyframe and errors until next keyframe if i set slice-max-size=1400 (what i usually use) in advanced x264 settings in OBS. I noticed this makes every large DTLS packet over port 8000 to come in pairs, one sized 1400 and one sized 120, so i set slice-max-size=1280 and now every DTLS packet is "not fragmented", and playback is nearly perfect, no hanging, stuttering or errors except when there actually are network errors.
is this a bug with srs handling of packets RTMP->WEBRTC or just something to be wary of ?

@winlinvip winlinvip added the WebRTC WebRTC, RTC2RTMP or RTMP2RTC. label Jun 16, 2021
@dongzy08
Copy link

In file srs_kernel_rtc_rtp.hpp,
change "const int kRtpPacketSize = 1500;" to "const int kRtpPacketSize = 1400;" , or 1300.
rebuild the srs, maybe help.

@winlinvip winlinvip changed the title webrtc playback hanging and corrupted if slice-max-size x264 parameter larger than DTLS MTU WebRTC: playback hanging and corrupted if slice-max-size x264 parameter larger than DTLS MTU Aug 18, 2021
@winlinvip winlinvip added this to the SRS 4.0 release milestone Aug 25, 2021
@chen-guanghua
Copy link
Contributor

chen-guanghua commented Sep 11, 2021

@rajkosto according to your comment, there are three points to be discussed.

  1. The slice-max-size=1400 should not make the DTLS packet size large. The increase in DTLS packet size may be caused by the certificate used during DTLS negotiation. If you provide a Wireshark capture file, it will make it easier to check the issue.

  2. The DTLS packet not being fragmented may be caused by SSL_set_mtu. The MTU size should be checked.

  3. The default value of kRtpPacketSize is 1500. It should be adjusted according to the MTU and UDP packet header. We will commit a pull request to adjust kRtpPacketSize.

TRANS_BY_GPT3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT. WebRTC WebRTC, RTC2RTMP or RTMP2RTC.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants