MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: Screensharing a specific window will only stream at ~5 FPS

Open
#4,176 5 comments 9 reactions 1 assignee View on GitHub

@srwei is already working on this.

Since Nov 17, 2023.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

What happened?

Admittedly, I do not have a good reproducible example, as my project is:

  1. Indirectly using WebView2 (via Tauri)
  2. Using it to display an external website, not my own. (Discord, in case that is relevant)

I apologize :(

Regardless, this is a problem I've debugged pretty heavily, and it's come down to this:

  1. Firefox window and desktop streaming works fine. Hits the target FPS (~30) and bitrate is fine. Webcam streaming also works fine.
  2. Chrome streaming has a similar (if not, the same) issue. FPS is a consistent ~5 FPS, but the bitrate is fine. Webcam streaming starts poorly but becomes fine over about 10 seconds, almost on par with Firefox.
  3. WebView2 streaming is almost identical to Chrome. When streaming a window, FPS is ~5. When streaming a whole desktop, FPS is around the target (~30). Webcam is also the same (starts poorly, gets better). Bitrate is also fine in all instances.

A couple other notes:

  • The codecs used in all cases was H.264. I do not believe I can easily force something like VP9, if at all.
  • A similar issue already existed, describing not quite the same thing, but similar. It was closed, but can be found at #2905
  • Streaming locally, eg. from my WebView2 app, and viewing that stream locally (eg. through another browser) seems to be fine? Unsure if that was just a fluke of testing.
  • I use a weird setup that uses the iGPU for one monitor, and my 3070 for the other. I do not believe this impacts the issue though, as I am told others (presumably without the same wonky setup) also experience the same issue.
  • From my searching, this may be a Chromium bug, but I am not in the browser engine space enough to know why, how, or what could be done about that on my or Microsoft's end. Any guidance for further debugging would be appreciated!

Something must be up with window capturing. Electron doesn't seem to struggle with this, so perhaps they have made some change in the screen sharing system that fixes this.

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

119.0.2151.58

SDK Version

WebView2Utilities crashes when refreshing the host app tab

Framework

Other

Operating System

Windows 10

OS Version

Windows 10 22H2 19045.3693

Repro steps
  1. In a WV2 application, create a WebRTC video stream and stream a window of an application.
    1.1 Specifically a window. Full desktop streaming, and webcam streaming, both seem to work fine.
  2. On another internet connection/device, view the video stream. The bitrate should be fine, but the framerate quite poor.

The way I do this is via Discord. To get my above information, I started a new stream with some window, then had a friend view it, and relay the different statuses (FPS, bitrate) of the streams while I restarted the streams using different browsers.

Regression

No, this never worked

Last working version (if regression)

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.