Reputation: 709
I'm trying to simultaneously show multiple streams from a same video cam but in different resolution qualities. I call getUserMedia() two times, but with different resolution constraints (hd and vga). The problem is that once the stream is first created, new stream cannot be created until first one is destroyed/stopped. The second getUserMedia() should use vga settings, but it uses hd settings from the first getUserMedia().
function getMedia(HDconstraints){
navigator.getUserMedia(HDconstraints, successCallback, errorCallback);
}
function getMedia2(VGAconstraints){
navigator.getUserMedia(VGAconstraints, successCallback2, errorCallback);
}
successCallback2 is using HDconstraints unless I stop the first stream before calling getMedia2().
Upvotes: 3
Views: 1592
Reputation: 709
Answering my own question: It seems that problem was that I was taking standard resolution ratios (e.g. 1920x1080), but camera's ratio was 1:1,35 leading to deformed picture quality when put in fixed dimensions video tag. Just needed to adjust video constraints to a 1:1,35 ratio (e.g. 1620x1200).
Upvotes: 3