How to use the constant resolution during webrtc video transmission?

柔情痞子 提交于 2021-02-08 01:22:57

问题


I am using janus to build my webrtc SFU server. I need the chrome browser to send the video resolution from a start to a fixed value and remain unchanged during the transfer. Where should I set it?

I tried setting the degradationPreference in the js code, but it didn't work, the resolution will still change, it seems that chrome does not support this parameter.

var senderList = config.pc.getSenders();
var sender = config.pc.getSenders().find(function(s) {return s.track.kind == "video"});
if(sender) {
    var parameters = sender.getParameters();
    parameters.degradationPreference = "maintain-resolution";
    sender.setParameters(parameters);
}

Image1 with varying resolution

Image2 with varying resolution

I looked at frameHeightSend/frameWidthSend in chrome://webrtc-internals, hoping it will keep the same value from the start, but now it grows slowly at startup and will fluctuate during subsequent transfers.

I found a message that sets the constant resolution in IOS, which is set when the screen is shared, and whether there are similar settings in chrome.

来源:https://stackoverflow.com/questions/57884828/how-to-use-the-constant-resolution-during-webrtc-video-transmission

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!