我在我的一个项目中使用RTCMulticonnection,我想把视频流的带宽限制在500-600kbp。我想把视频流的带宽限制在500-600kbp。我通过 文件 并设置 空间数据平台制约因素 与 带宽汉德勒......我把宽度减少到320p,高度减少到180使用 媒资约束......但仍然是2-2.5 Mbps,在发送和接收时都使用。
以下是我使用的代码
<script src="https://rtcmulticonnection.herokuapp.com/dist/RTCMultiConnection.min.js"></script>
<script src="https://rtcmulticonnection.herokuapp.com/socket.io/socket.io.js"></script>
<script>
var connection = new RTCMultiConnection();
// this line is VERY_important
connection.socketURL = 'https://rtcmulticonnection.herokuapp.com:443/';
// if you want audio+video conferencing
connection.session = {
audio: true,
video: true
};
connection.mediaConstraints = {
audio: true,
video: {
mandatory: {
minWidth: 360,
maxWidth: 360,
minHeight: 180,
maxHeight: 180,
minFrameRate: 15,
minAspectRatio: 1.77
}
}
};
if (DetectRTC.browser.name === 'Firefox') {
connection.mediaConstraints = {
audio: true,
video: {
width: 360,
height: 180,
frameRate: 15,
aspectRatio: 1.77
}
};
}
var BandwidthHandler = connection.BandwidthHandler;
connection.bandwidth = {
audio: 90,
video: 400,
screen: 360
};
connection.processSdp = function(sdp) {
sdp = BandwidthHandler.setApplicationSpecificBandwidth(sdp, connection.bandwidth, !!connection.session.screen);
sdp = BandwidthHandler.setVideoBitrates(sdp, {
min: connection.bandwidth.video,
max: connection.bandwidth.video
});
sdp = BandwidthHandler.setOpusAttributes(sdp);
sdp = BandwidthHandler.setOpusAttributes(sdp, {
'stereo': 1,
//'sprop-stereo': 1,
'maxaveragebitrate': connection.bandwidth.audio * 1000 * 8,
'maxplaybackrate': connection.bandwidth.audio * 1000 * 8,
//'cbr': 1,
//'useinbandfec': 1,
// 'usedtx': 1,
'maxptime': 3
});
return sdp;
};
connection.openOrJoin('your-room-id');
</script>
那是我做错了什么吗?