I am testing a peer to peer video chat app using webrtc. when I set the video contraints as
var video_constraints = {
mandatory: {
maxHeight: 120,
maxWidth: 160
},
optional: []
};
window.navigator.webkitGetUserMedia({
audio: true,
video: video_constraints
}, onSuccess, onError);
this fires onError. what could be the reason?
The video stream provided by getUserMedia should give you uncompressed video at the highest quality available from the camera hardware. There is no way to adjust the camera settings; they are fully automatic, controlled by the camera driver and/or operating system.
Most WebRTC implementations to date have been able to reach 720p resolutions, with 1080p starting to be introduced.
To quote from code.google.com/p/chromium/issues/detail?id=143631#c9:
GetUserMedia constraints are matched with a fixed list of resolutions independent on what the camera actually support. The list is fixed and used on all platforms.
1280, 720,
960, 720,
640, 360,
640, 480,
320, 240,
320, 180
This means your constraints will fail.
Constraints are also documented in Harald Alvestrand's IETF draft.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With