Bug 255441

Summary: getDisplayMedia fails to capture stream with various video constraints
Product: WebKit Reporter: sknth.n
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Critical CC: cdumez, eric.carlson, scaret.in, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: All   
OS: macOS 13   
Attachments:
Description Flags
Console log from safari containing the failure none

Description sknth.n 2023-04-13 23:59:29 PDT
Created attachment 465910 [details]
Console log from safari containing the failure

We're observing this issue on the current setups:
MacOS: 13.2.1 Ventura
Safari 16.3, 16.4
It is reproducible every time.

Safari has been given Screen Recording permissions in the System settings.

When we try to share the screen, it fails with this error in the console:
"A MediaStreamTrack ended due to a capture failure"

I tried experimenting with the video constraints while calling getDisplayMedia(). When sending a basic object in as video constraints like below, the screen sharing works perfectly fine.
{
    aspectRatio: 1.777,
    frameRate: 10,
}


However, if we send in video constraints like these, we observe the problem.
{
    "cursor": "always",
    "aspectRatio": 1.77,
    "frameRate": 10,
    "height": 1080,
    "width": 1920
}

{
    cursor: "always",
    frameRate: 10,
    height: 1080,
    idealHeight: 1080,
    idealWidth: 1920,
    maxHeight: 1080,
    maxWidth: 1920,
    width: 1920
}
Comment 1 sknth.n 2023-04-14 00:01:26 PDT
Changing component to WebRTC as this is an issue with getDisplayMedia
Comment 2 Radar WebKit Bug Importer 2023-04-14 01:12:46 PDT
<rdar://problem/108037645>
Comment 3 sknth.n 2023-04-16 23:23:45 PDT
This issue is observed on Safari Version 16.4 (18615.1.26.11.22)
Comment 4 youenn fablet 2023-04-21 05:11:07 PDT
I am not able to reproduce locally.
If getting "A MediaStreamTrack ended due to a capture failure", it probably means the capturing session got an error. Could you send me (youenn@apple.com) a sysdiagnose with the timing where the issue reproduced?
Are you able to reproduce either in latest STP?


Thanks,
    y
Comment 5 sknth.n 2023-05-04 23:51:55 PDT
(In reply to youenn fablet from comment #4)
> I am not able to reproduce locally.
> If getting "A MediaStreamTrack ended due to a capture failure", it probably
> means the capturing session got an error. Could you send me
> (youenn@apple.com) a sysdiagnose with the timing where the issue reproduced?
> Are you able to reproduce either in latest STP?
> 
> 
> Thanks,
>     y

Will try to get this.
Comment 6 Derek Lu 2023-05-07 22:59:48 PDT
this one?

https://bugs.webkit.org/show_bug.cgi?id=247310

(In reply to sknth.n from comment #0)
> Created attachment 465910 [details]
> Console log from safari containing the failure
> 
> We're observing this issue on the current setups:
> MacOS: 13.2.1 Ventura
> Safari 16.3, 16.4
> It is reproducible every time.
> 
> Safari has been given Screen Recording permissions in the System settings.
> 
> When we try to share the screen, it fails with this error in the console:
> "A MediaStreamTrack ended due to a capture failure"
> 
> I tried experimenting with the video constraints while calling
> getDisplayMedia(). When sending a basic object in as video constraints like
> below, the screen sharing works perfectly fine.
> {
>     aspectRatio: 1.777,
>     frameRate: 10,
> }
> 
> 
> However, if we send in video constraints like these, we observe the problem.
> {
>     "cursor": "always",
>     "aspectRatio": 1.77,
>     "frameRate": 10,
>     "height": 1080,
>     "width": 1920
> }
> 
> {
>     cursor: "always",
>     frameRate: 10,
>     height: 1080,
>     idealHeight: 1080,
>     idealWidth: 1920,
>     maxHeight: 1080,
>     maxWidth: 1920,
>     width: 1920
> }
Comment 7 sknth.n 2023-05-09 00:42:54 PDT
We can close this. We're no longer able to reproduce the issue on the later builds of Safari 16.4
Comment 8 youenn fablet 2023-05-09 01:24:56 PDT
Thanks for the report, marking as configuration changed.