Chrome 27 Stable - GetUserMedia() Resolution Constraints Not Working

898 views
Skip to first unread message

Manjesh (GoCast)

unread,
Jun 11, 2013, 11:26:17 PM6/11/13
to discuss...@googlegroups.com
Hi,

I have observed in Chrome 27 that getUserMedia()'s resolution constraints don't work. Even though I have set both max and min dimensions to 320 X 240, when I dump the stats, I see that it's capturing at 640 X 480. Has anybody else observed this?

Any help is greatly appreciated.

Thanks,

Manjesh

Silvia Pfeiffer

unread,
Jun 12, 2013, 2:05:46 AM6/12/13
to discuss...@googlegroups.com
It may have to do with what your camera supports. Try setting a range
of options and let the browser work out what it is able to get.

Silvia.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "discuss-webrtc" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to discuss-webrt...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Alexandre GOUAILLARD

unread,
Jun 12, 2013, 4:42:08 PM6/12/13
to discuss...@googlegroups.com
dear manjesh,

Constraints are just "hints" given to GUM. If your camera does not have a video mode compatible with your constraints, it defaults to 640x480.

In some of our early experiment to understand how this works, we used the constraint demo (http://webrtc.googlecode.com/svn/trunk/samples/js/demos/html/constraints-and-stats.html) and we "sampled" the possible modes by leaving the vertical constraint completely open (min=0, max = 1280) and slowly variating the horizontal min/max. We ended up with only three modes for a macBookAir laptop for example.

The demo allows for quick testing, to see what makes sense for you. Note that it's difficult to assume anything about the cam hardware of each user.

alex.


Justin Uberti

unread,
Jun 16, 2013, 5:18:36 PM6/16/13
to discuss-webrtc
If the camera doesn't support a 320x240 mode, you'll get 640x480, IIRC. This isn't quite right if the resolution constraints were mandatory; we will be overhauling some of the resolution constraints code in the not-too-distant future.
Reply all
Reply to author
Forward
0 new messages