Closed Bug 1692873 Opened 5 years ago Closed 1 year ago

is screenshare simulcast supported?

Categories

(Core :: WebRTC, defect, P2)

Firefox 87
defect

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: work, Assigned: pehrsons)

References

Details

(Keywords: dev-doc-complete)

Attachments

(9 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36

Steps to reproduce:

I'm trying to publish a screensharing stream in simulcast but only one ssrc is received by the SFU.
Also, when I use replacetrack with a screen track in a correctly published webcam simulcast stream, the number of layers (temporal and spatials) drops to 1 until the webcam stream is replaced again.

this can also be tested in https://github.com/fippo/simulcast-playground/blob/gh-pages/rid-as-mid.html changing line 35 to do a getDisplayMedia()

Actual results:

Only one ssrc is sent to other party and no simulcast is being published.

Expected results:

At least couple of temporal layer should be published by Firefox when screensharing in simulcast.

The Bugbug bot thinks this bug should belong to the 'Core::Privacy: Anti-Tracking' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Privacy: Anti-Tracking
Product: Firefox → Core
Component: Privacy: Anti-Tracking → Audio/Video

(In reply to Release mgmt bot [:sylvestre / :calixte / :marco for bugbug] from comment #1)

The Bugbug bot thinks this bug should belong to the 'Core::Privacy: Anti-Tracking' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Flags: needinfo?(drno)

I think it should work. But it sounds like we have a bug there. It might be that Firefox old version of libwebrtc prevents simulcast of screen shares... I think I might have seen some code like that.

Component: Audio/Video → WebRTC
Flags: needinfo?(drno)

(In reply to Francesco Durighetto from comment #0)

this can also be tested in https://github.com/fippo/simulcast-playground/blob/gh-pages/rid-as-mid.html changing line 35 to do a getDisplayMedia()

Francesco, would you mind providing more details around this? I've tried this, but must not be doing exactly what you are because I get nothing at all on the screen after modifying line 35.

Flags: needinfo?(work)

(In reply to Michael Froman [:mjf] from comment #4)

(In reply to Francesco Durighetto from comment #0)

this can also be tested in https://github.com/fippo/simulcast-playground/blob/gh-pages/rid-as-mid.html changing line 35 to do a getDisplayMedia()

Francesco, would you mind providing more details around this? I've tried this, but must not be doing exactly what you are because I get nothing at all on the screen after modifying line 35.

You can try to copy the following code into an HTML page: https://pastebin.com/duKPSGmN

note that not always the video is subscribed and displayed in the tabs. reload the page few times to get an idea of what I'm assuming is a bug

Flags: needinfo?(work)
Flags: needinfo?(mfroman)

I've tried this with our in-progress libwebrtc update and did not have luck (insta-crash). I think we're not quite far enough along for this particular use case. I see this as interesting in the log when running a debug build:

[Child 20601, Main Thread] WARNING: NS_ENSURE_TRUE(info) failed: file {path-to-source}/extensions/permissions/PermissionDelegateHandler.cpp:348

I'll capture screen shots of the html in Comment 5 so we can have additional conversations.

FYI: I'm using the attached test.html file in a directory, served by running python3 -m http.server.

Attached image results from test.html

Here is what I see when using test.html when locally served. This doesn't seem to work at all in Chrome. I'm not exactly sure what I'm supposed to see.

Flags: needinfo?(mfroman)

I'm able to repro:

  • with this fiddle, I get just one (large) video,
  • whereas in Chrome, or s/getDisplayMedia/getUserMedia/ it works: shows 3 videos (small, medium, large).

This does not appear to be a regression. I was able to go back to 2018-08-01 (using an older fiddle to go past bug 1405495). But past that I run into some stricter tests we used to have that trip up fippo's simulcast hack: DOMException: "Answer changes mid for level, was 'sdparta_0', now '0'"

I think it is safe to at least switch the bug to confirmed

I'm going to guess that there's no chance of this working until we're done with bug 1654112. It is possible that bug 1654112 will be sufficient, since we do not differentiate between screenshare and camera in our simulcast negotiation/configuration code, I think.

Severity: -- → S3
Depends on: 1654112
Priority: -- → P3

Hi, wondering if there was an update on this or a plan to get it fixed anytime soon? Thank you.

Here's an updated fiddle showing the problem more clearly. Chrome sends 4,2,1, Safari sends 1,1,1, (likely only a defaults problem), while Firefox only sends 4 for some reason.

Duplicate of this bug: 1855584
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: P3 → P2
Assignee: nobody → jib
Status: NEW → ASSIGNED

Let's get this landed.

Assignee: jib → apehrson

For debugging purposes, when the test fails in CI and creates a screenshot.
gDM sources tend to be large, and for the sake of this test they should be
encoded large too. This shrinks the dimensions of the rendered video tracks
instead.

Attachment #9355881 - Attachment description: Bug 1692873 - enable simulcast for screensharing sources. r?pehrsons → Bug 1692873 - Enable simulcast for screensharing sources. r?jib
Pushed by pehrsons@gmail.com: https://hg.mozilla.org/integration/autoland/rev/88a33c282af1 Test simulcast screenshare in webrtc/simulcast/screenshare.https.html WPT. r=bwc https://hg.mozilla.org/integration/autoland/rev/154f072ea936 Add VideoConduit gtests for screensharing. r=webrtc-reviewers,ng https://hg.mozilla.org/integration/autoland/rev/fd77389cbc70 Add mochitest for simulcast screensharing. r=jib https://hg.mozilla.org/integration/autoland/rev/d88f2751aa16 Create smaller video elements for playback in simulcast tests. r=jib https://hg.mozilla.org/integration/autoland/rev/26a05286fa42 Enable simulcast for screensharing sources. r=jib https://hg.mozilla.org/integration/autoland/rev/d4850b36e2ff Use the same number of temporal layers for both screensharing and non-screensharing simulcast. r=webrtc-reviewers,ng

Adding dev-doc-needed because it would be good to get a note in the release notes for developers, under WebRTC, that "MediaStreamTracks for screen and window capture, i.e. originating from getDisplayMedia, can now be encoded as multiple simulcast layers when using VP8."

Keywords: dev-doc-needed
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/49266 for changes under testing/web-platform/tests

Backed out for causing wpt failures @ screenshare.https.html

TEST-UNEXPECTED-FAIL | /webrtc/simulcast/screenshare.https.html | Basic simulcast setup with two spatial layers - promise_test: Unhandled rejection with value: object "TypeError: navigator.mediaDevices.getDisplayMedia is not a function"
Flags: needinfo?(apehrson)
Upstream PR was closed without merging
Flags: needinfo?(apehrson)
Pushed by pehrsons@gmail.com: https://hg.mozilla.org/integration/autoland/rev/efbb9e1af880 Test simulcast screenshare in webrtc/simulcast/screenshare.https.html WPT. r=bwc https://hg.mozilla.org/integration/autoland/rev/c547e3d451c5 Add VideoConduit gtests for screensharing. r=webrtc-reviewers,ng https://hg.mozilla.org/integration/autoland/rev/a93266847c8c Add mochitest for simulcast screensharing. r=jib https://hg.mozilla.org/integration/autoland/rev/1b2720a24c44 Create smaller video elements for playback in simulcast tests. r=jib https://hg.mozilla.org/integration/autoland/rev/70fa4bed6f07 Enable simulcast for screensharing sources. r=jib https://hg.mozilla.org/integration/autoland/rev/304638224e18 Use the same number of temporal layers for both screensharing and non-screensharing simulcast. r=webrtc-reviewers,ng
Regressions: 1932381
Regressions: 1932382
Upstream PR merged by moz-wptsync-bot

FF134 MDN work for this can be tracked in https://github.com/mdn/content/issues/36914

Unfortunately I have no idea how to even start with this. I know what simulcast means, but not what the APIs a developer users to implement it are - existing MDN docs do not even define the term.

Can you help scope the problem for me:

  1. Is this new functionality or a bug fix?
  2. If new functionality, what WebRTC interfaces were added/removed etc.
  3. Can you propose a release note you'd like for the MDN release notes?

Depending on your answer I'll see if I can find someone in the docs team with more WebRTC experience than me to help.

Flags: needinfo?(apehrson)

(In reply to Hamish Willee from comment #32)

  1. Is this new functionality or a bug fix?

More of a bug fix. We have supported simulcast with VP8 for non-screensharing video for the longest time, but didn't for screensharing video for historical reasons relating to an external library. With this bug we treat both types of video the same, though they're handled a bit differently under the hood.

  1. If new functionality, what WebRTC interfaces were added/removed etc.

n/a

  1. Can you propose a release note you'd like for the MDN release notes?

See comment 25!

Thanks

Flags: needinfo?(apehrson)

Thanks very much. I added the release note in https://github.com/mdn/content/pull/37020

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: