webrtcHacks - getUserMedia resolutions III – constraints unleashed
Back in October 2013, the relative early days of WebRTC, I set out to get a better understanding of the getUserMedia API and camera constraints in one of my first and most popular posts. I discovered that working with getUserMedia constraints was not all that straight forward. A year later I gave an update after the situation with Chrome was greatly improved, but Firefox at the time effectively only supported a single resolution so constraints were not much help. Specifically, I am interested in understanding what happens when you ask for a specific resolution. You might want to have a specific resolution returned by getUserMedia if you want to match the camera resolution to a specific video area to have a 1 to 1 pixel correlation, in a computer vision application where each pixel represents a distance, or if you are dealing with non-standard video devices.
Now it has been another fifteen months and a lot has changed since that last post. getUserMedia, WebRTC’s most mature API is supposedly nearing standardization. The spec gone through several updates and we have full support from Firefox and Edge. I was hoping this post would be a quick code update and simple data addition to my last post to reflect these updates. It ended up being a lengthly process process that resulted in some confusing and nonintuitive results.
See the full post for summary results and full details: getUserMedia resolutions III – constraints unleashed.