I am capturing the user's camera, i want to catch the picture with the best resolution possible, so my code is something like the snippet below,
I want to read the resolution details from the incoming stream, so i can set it as video height and width, which I ll use to click snapshot, I want the snapshot to be of best quality offered by the stream, is this possible( to read resolution details from stream
variable) ?
EDIT : I am transmitting the video using webrtc
so I would also like to find out the frame rate of the transmitted videostream
$(document).ready(function(){
navigator.getUserMedia = ( navigator.getUserMedia ||navigator.mozGetUserMedia ||navigator.webkitGetUserMedia ||navigator.msGetUserMedia);
if(navigator.getUserMedia){
navigator.getUserMedia({ video: true, audio:true}, function(stream) {
var video = $('#video')[0];
video.src = window.URL.createObjectURL(stream);
video.muted=true;
//$('#video').hide();
}, function(){
showMessage('unable to get camera', 'error');
});
}else{
showMessage('no camera access mate.', 'error');
}
function showMessage(msg,type) { // type 'success' or 'error'
$('#msg').text(msg);
}
})
the html code:
<div id='msg' class'message'></div>
<div >
<video id='video' autoplay></video>
</div>