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

RTC2RTMP: Fix screen sharing stutter caused by packet loss. v5.0.216 v6.0.157 v7.0.18 #4160

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

suzp1984
Copy link
Contributor

@suzp1984 suzp1984 commented Aug 28, 2024

How to reproduce?

  1. Refer this commit, which contains the web demo to capture screen as video stream through RTC.
  2. Copy the trunk/research/players/whip.html and trunk/research/players/js/srs.sdk.js to replace the develop branch source code.
  3. ./configure && make
  4. ./objs/srs -c conf/rtc2rtmp.conf
  5. open http://localhost:8080/players/whip.html?schema=http
  6. check Screen radio option.
  7. click publish, then check the screen to share.
  8. play the rtmp live stream: rtmp://localhost/live/livestream
  9. check the video stuttering.

Cause

When capture screen by the chrome web browser, which send RTP packet with empty payload frequently, then all the cached RTP packets are dropped before next key frame arrive in this case.

The OBS screen stream and camera stream do not have such problem.

Add screen stream to WHIP demo

Screenshot 2024-08-28 at 2 49 46 PM

@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Aug 28, 2024
@winlinvip winlinvip changed the title fix rtp packet loss when bridge rtc to rtmp. RTC2RTMP: Fix screen sharing stutter caused by packet loss. Oct 15, 2024
@winlinvip winlinvip changed the title RTC2RTMP: Fix screen sharing stutter caused by packet loss. RTC2RTMP: Fix screen sharing stutter caused by packet loss. v5.0.216 v6.0.157 v7.0.18 Oct 15, 2024
@winlinvip winlinvip added the RefinedByAI Refined by AI/GPT. label Oct 15, 2024
@winlinvip winlinvip merged commit 101382a into ossrs:develop Oct 15, 2024
16 of 17 checks passed
winlinvip added a commit that referenced this pull request Oct 15, 2024
…4160)

1. Refer this commit, which contains the web demo to capture screen as
video stream through RTC.
2. Copy the `trunk/research/players/whip.html` and
`trunk/research/players/js/srs.sdk.js` to replace the `develop` branch
source code.
3. `./configure && make`
4. `./objs/srs -c conf/rtc2rtmp.conf`
5. open `http://localhost:8080/players/whip.html?schema=http`
6. check `Screen` radio option.
7. click `publish`, then check the screen to share.
8. play the rtmp live stream: `rtmp://localhost/live/livestream`
9. check the video stuttering.

When capture screen by the chrome web browser, which send RTP packet
with empty payload frequently, then all the cached RTP packets are
dropped before next key frame arrive in this case.

The OBS screen stream and camera stream do not have such problem.

><img width="581" alt="Screenshot 2024-08-28 at 2 49 46 PM"
src="https://github.com/user-attachments/assets/9557dbd2-c799-4dfd-b336-5bbf2e4f8fb8">

---------

Co-authored-by: winlin <winlinvip@gmail.com>
winlinvip added a commit that referenced this pull request Oct 15, 2024
…4160)

1. Refer this commit, which contains the web demo to capture screen as
video stream through RTC.
2. Copy the `trunk/research/players/whip.html` and
`trunk/research/players/js/srs.sdk.js` to replace the `develop` branch
source code.
3. `./configure && make`
4. `./objs/srs -c conf/rtc2rtmp.conf`
5. open `http://localhost:8080/players/whip.html?schema=http`
6. check `Screen` radio option.
7. click `publish`, then check the screen to share.
8. play the rtmp live stream: `rtmp://localhost/live/livestream`
9. check the video stuttering.

When capture screen by the chrome web browser, which send RTP packet
with empty payload frequently, then all the cached RTP packets are
dropped before next key frame arrive in this case.

The OBS screen stream and camera stream do not have such problem.

><img width="581" alt="Screenshot 2024-08-28 at 2 49 46 PM"
src="https://github.com/user-attachments/assets/9557dbd2-c799-4dfd-b336-5bbf2e4f8fb8">

---------

Co-authored-by: winlin <winlinvip@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RefinedByAI Refined by AI/GPT. TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants