WebRTC Simulcast / Multistream

I am trying to simultaneously display several streams from one video camera, but with different resolution qualities. I call getUserMedia () two times, but with different resolution constraints (hd and vga). The problem is that once a thread is created, a new thread cannot be created until the first one is destroyed / stopped. The second getUserMedia () should use the vga settings, but it uses the hd settings from the first getUserMedia ().

function getMedia(HDconstraints){
navigator.getUserMedia(HDconstraints, successCallback, errorCallback);
}

function getMedia2(VGAconstraints){
navigator.getUserMedia(VGAconstraints, successCallback2, errorCallback);
}

      

successCallback2 uses HDconstraints unless I stop the first thread prior to calling getMedia2 ().

+3


source to share


1 answer


Answering my own question: It seems the problem was that I was accepting standard resolutions (e.g. 1920x1080), but the camera ratio was 1: 1.35, resulting in warped image quality when setting the fixed size video tag. You just need to set the video limits to a 1: 1.35 ratio (eg 1620x1200).



+3


source







All Articles