I tried this and this, but the maximum resolution I can get is 640x480.
The pictures taken by other windows apps by the same camera have the resolution of 1600x1200.
Is there any limit for resolution in WebRTC?
I cannot find any official documentation about that.
-
for me it works fine in chrome, and 640x480 for firefox – hope_is_grim Jul 06 '13 at 12:34
-
Firefox uses an updated syntax. See http://stackoverflow.com/questions/28282385/webrtc-firefox-constraints/28911694#28911694 – jib Mar 07 '15 at 05:59
2 Answers
You can do it by using constraints and passing those to getUserMedia as shown in the links you provided. It's possible that your webcam only supports 640x480 for video and higher resolutions for still images (this is common).
Here's another example, where you can try setting various resolutions and it will print out the corresponding constraints object: http://webrtc.googlecode.com/svn/trunk/samples/js/demos/html/constraints-and-stats.html
For example, to try to force it to 720p at 30FPS:
{
"audio": true,
"video": {
"mandatory": {
"minWidth": "1280",
"maxWidth": "1280",
"minHeight": "720",
"maxHeight": "720",
"minFrameRate": "30"
},
"optional": []
}
}
Note that the current spec does not allow querying the hardware capabilities, due to concerns over privacy due to fingerprinting: http://lists.w3.org/Archives/Public/public-media-capture/2012Jan/0014.html

- 4,127
- 1
- 17
- 15
-
Tom, I am having the same problem as OP under Chrome 30.0.1599.101m. When I set a mandatory minimum resolution to 640x480, WebRTC won't bother trying higher resolutions (even though they're available). If I set minimum resolution to 1080p it'll use that higher resolution. Is that normal? I am expecting it to try 1080p even when minimum resolution is set to 640x480. – Gili Oct 29 '13 at 15:49
Note that Firefox does not yet support those constraints, though we will. We do have options for width and height in about:config (look in media.*) in the meantime.
Update
Currently Firefox supports the latest spec constraints for getUserMedia, in particular for width & height. These are considerably different than the older constraints mentioned here, and different than the somewhat newer constraints still used by Chrome (who will be moving to the spec constraints sometime soon).

- 6,765
- 27
- 32
-
Just as a side note, those settings are : `media.navigator.video.default_width` and `media.navigator.video.default_height`. @jesup, Any idea of when it will be available? – Kaiido Nov 03 '14 at 22:06