Bug 179994 - can not control framerate & resolution using getusermedia
Summary: can not control framerate & resolution using getusermedia
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 11
Hardware: PC OS X 10.11
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-11-24 00:36 PST by xpeng
Modified: 2020-05-28 03:18 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description xpeng 2017-11-24 00:36:58 PST
There is a camera support 1920*1080*30fps 1280*720*30fps 640*360*30fps 1920*1080*15fps 1280*720*15fps 640*360*15fps 
call getusermedia to get video with 1920*1080*15fps/ 1280*720*15fps/ 640*360*15fps, we can only get the 1280*720 video, the framerate is more than 15fps.
Comment 1 youenn fablet 2017-11-27 07:45:16 PST
Hi xpeng, can you give more details, like how you are using getUserMedia constraints?
Comment 2 xpeng 2017-12-05 01:00:53 PST
you can try the demo :
https://pencil240.github.io/ConstraintsChecker/
Comment 3 christian.rest 2018-07-19 03:23:49 PDT
I think I am encountering this same bug with Safari 11.0 on iOS 11.4.1. The highest resolution it returns is 1280x720 (30fps), even when requesting ideal constraints that are much higher.
Of course 1280x720 is not the maximum resolution that my Iphone's camera natively supports, so I'm suspecting a Safari bug.
The test site that xpeng linked to actually demonstrates the behaviour quite well for me, too (i.e. requesting 1080p but still only getting 720p).
Comment 4 mkaisercross 2019-02-26 09:36:08 PST
I am also encountering this on Desktop Safari 12.0 (14606.1.36.1.9). I am requesting 1080p video and it simply returns

OverconstrainedError {message: "Invalid constraint", constraint: ""}  


I have tried a couple different constraints objects (shown below) but they all produce the same error. Only if I lower the min width to 720 and the min height to 140

{
    video: {
        width: 1920,
        height: 1080
    }
}

{
    video: {
        width: {min:1080},
        height: {min:1920}
    }
}

If I use the constraints below I can open a 720p feed.

{
    video: {
        width: 720,
        height: 1280
    }
}

{
    video: {
        width: {min:720},
        height: {min:1280}
    }
}


Our intended use case is document authentication and OCR so we need highest resolutions possible on both desktop and mobile browsers. Ideally we would like to be getting in the 600 DPI which would require 4k resolution but 300 DPI is also usable for us which requires 1080p resolution. Is there a reason why the browsers don't simply allow whatever the camera supports? Is it a performance issue? We are testing on a Logitech C920 btw. Also we are having the same 720p limitation in Firefox but Chrome has no issue with 1080p.
Comment 5 Radar WebKit Bug Importer 2020-05-22 08:56:12 PDT
<rdar://problem/63541765>
Comment 6 youenn fablet 2020-05-28 03:18:23 PDT
Resolutions seem to pass in https://pencil240.github.io/ConstraintsChecker/.
As of frame rate, we have fixed it in https://bugs.webkit.org/show_bug.cgi?id=210186.
You can test it in STP.
I also tried https://webrtc.github.io/samples/src/content/getusermedia/resolution/ on an iPhone running iOS 13.4 and it works fine there.
@mkaisercross, would you be able to test on Safari Tech Preview and let me know whether that works for you as well, I haven't tested with the camera you are using?
Please reopen or file another issue.