I am using the getUserMedia function to record video from a webcam. Everyting works fine, except that it was only recording in 640x480 resolution, when I just specified video: true for the constraint.
If I set the constraint as below, I now get better quality recording on my laptop:
var mediaConstraints = {
audio: true,
video: {
width: { min: 1280 },
height: { min: 720 }
}
};
But what if another device is capable of better than 1280x720, or has even lower capabilities?
I tried playing around with setting min to be very low, and max to be very high; but it just defaulted to 640x480, or gave nothing at all. I also tried setting the desired size, but as expected - I just ended up with whatever that value was. If I set desired to be very high (so it would choose the closest available), I ended up with nothing.
So the question is, how to set the constraints to get whatever the maximum resolution a camera can provide?