MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
431 stars 51 forks source link

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

Open SpikeHD opened 9 months ago

SpikeHD commented 9 months ago

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:

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

CodeCubeNeo commented 7 months ago

Any updates?

plutonium-239 commented 2 weeks ago

I second this issue. Commenting for activity.