-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PTZ] Should pan, tilt, and zoom double constraints apply to getUserMedia? #224
Comments
Web developers could have a priori knowledge of ranges (for instance if a user wants to resume a previously stopped video stream) in which case the site could issue
Even without a priori knowledge, it might make sense to use Resetting a PTZ camera to a sensible state might be quite important because the image quality of a PTZ camera may degrade drastically if a digital zoom level is high. |
The PTZ camera device could have been placed somewhere else or pointed in another direction, so those values are not guaranteed to still be good.
It seems to me that this is simply a shortcut of this code below. const stream = await navigator.mediaDevices.getUserMedia({
video: { pan: true, tilt: true, zoom: true, deviceId: '...' }
});
const videoTrack = videoStream.getVideoTracks()[0];
await videoTrack.applyConstraints({
advanced: [{ pan: 0, tilt: 0, zoom: 1 }],
}); I think providing a "reset" button to users would be a nice way for websites to reset the camera to a sensible state if that's their wish instead of assuming that this is the case. Note that on Android, the zoom property resets to "1" each time the camera is "opened" One thing I've learnt while reading about PTZ is that we can't make guesses about the values of pan and tilt and their meanings. They are even sometimes off. |
Calling |
I believe it is how it works with other parameters of |
I don't see any security or privacy concerns with allowing it even though it doesn't seem that useful. |
I guess it will be a matter of documenting best practices then. I'll close this non-issue now. |
Unless and until Chrome turns off the camera light when track.enabled is set to false, GUM will be frequently called in the same session to emulate Firefox' behaviour (see w3c/mediacapture-main#642) |
When would web developers set pan, tilt, and zoom double values as part of a
getUserMedia
call?As we're not sure which camera would be plugged in and cameras have different ranges for pan, tilt, and zoom, I'm not sure those values should be "set" or "applied" to the video stream, as they're not meaningful.
In other words, what does even mean providing
pan:1
without knowing the min and max values?In this case, shall we simply set them as boolean constraint for
getUserMedia
(or have as suggested initially one singlepanTiltZoom
boolean constraint) and keep double constraint forapplyConstraints
?One more thing. Could this code be a thing eventually?
Would it be a way to detect a certain type of camera?
The text was updated successfully, but these errors were encountered: