Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebRTC Simulcast/Multistream

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().

like image 826
Bade Avatar asked Aug 26 '26 04:08

Bade


1 Answers

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).

like image 118
Bade Avatar answered Aug 30 '26 07:08

Bade



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!