Skip to content

Conversation

@firvida
Copy link

@firvida firvida commented Aug 4, 2021

Prior to this commit the quality of the picture was taken from the video
html component, which in general will lead to pretty low resolution.

Instead of that, we add a video constraint, so if possible the video will
project a stream with height of at least 1080p. We store global height
and width from the selected stream and set the canvas to those when snap
is taken.

Prior to this commit the quality of the picture was taken from the video
html component, which in general will lead to pretty low resolution.

Instead of that, we add a video constraint, so if possible the video will
project a stream with height of at least 1080p. We store global height
and width from the selected stream and set the canvas to those when snap
is taken.
The function of the webcam isn't modified in this commit we just use
screen measurements to give video component better defaults which will
maybe be closer to the use case in which it is used.

Also if the screen resizes we should take care of the video resizing.
MV-GH added a commit to MV-GH/webcam-easy that referenced this pull request Dec 23, 2021
Allow to get high quality pictures
bensonruan#29

This was easier than actually building upon the pr
@MV-GH MV-GH mentioned this pull request Dec 23, 2021
videoConstraints.deviceId = { exact: this._selectedDeviceId};
}
/* Try to get a media stream that takes at least 1080p pictures */
videoConstraints.height = { min: 1080 }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

min means minimum supported resolution. So if you have smaller resolution camera you will not see it. I think here could be used ideal .

To require a capability, use the keywords min, max, or exact
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants