-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
My server has a 200 Mbps bandwidth, but only two of us are using it. However, Jitsi always forces the video to close to save bandwidth and then automatically restarts it!!! The resolution and bitrate I set are 1080P 6Mbps But my server's bandwidth is 200 Mbps
/* eslint-disable no-unused-vars, no-var, max-len */
// 禁用P2P
config.p2p.enabled = false;
// ========================================
// 强制60fps - 从一开始就要求(关键!)
// ========================================
config.constraints = config.constraints || {};
config.constraints.video = {
height: {
ideal: 1080,
max: 1080,
min: 1080 // 强制1080P,防止降级
},
width: {
ideal: 1920,
max: 1920,
min: 1920
},
frameRate: {
ideal: 30,
max: 30,
min: 30 // 强制60fps,不允许降到30
}
};
// 默认分辨率
config.resolution = 1080;
// 屏幕共享60fps
config.desktopSharingFrameRate = {
min: 60,
max: 60
};
config.constraints.desktop = {
video: {
height: { ideal: 2160, max: 2160, min: 1080 },
width: { ideal: 3840, max: 3840, min: 1920 },
frameRate: { ideal: 60, max: 60, min: 60 }
}
};
// ========================================
// 视频质量配置
// ========================================
config.videoQuality = config.videoQuality || {};
// 完全禁用自适应模式(防止降质)
config.videoQuality.enableAdaptiveMode = false;
// 屏幕共享码率
config.videoQuality.maxBitratesScreenSharing = {
VP9: 15000,
H264: 18000
};
// 编解码器优先级
config.videoQuality.codecPreferenceOrder = ['AV1', 'VP9', 'VP8', 'H264'];
config.videoQuality.mobileCodecPreferenceOrder = ['VP8', 'H264', 'VP9'];
config.videoQuality.av1 = {
maxBitratesVideo: {
low: 6000000,
standard: 6000000,
high: 6000000,
fullHd: 6000000,
ultraHd: 4000000,
ssHigh: 6000000
},
scalabilityModeEnabled: true,
useSimulcast: false,
useKSVC: true
};
config.videoQuality.h264 = {
maxBitratesVideo: {
low: 6000000,
standard: 6000000,
high: 6000000,
fullHd: 6000000,
ultraHd: 6000000,
ssHigh: 6000000
},
scalabilityModeEnabled: true
};
config.videoQuality.vp8 = {
maxBitratesVideo: {
low: 6000000,
standard: 6000000,
high: 6000000,
fullHd: 6000000,
ultraHd: 6000000,
ssHigh: 6000000
},
scalabilityModeEnabled: false
};
config.videoQuality.vp9 = {
maxBitratesVideo: {
low: 6000000,
standard: 6000000,
high: 6000000,
fullHd: 6000000,
ultraHd: 5000000,
ssHigh: 6000000
},
scalabilityModeEnabled: true,
useSimulcast: false,
useKSVC: true
};
// ========================================
// 帧率档位配置(所有档位都是60fps)
// ========================================
config.videoQuality.minFramerateForQualityLvl = {
low: 30, // 低档也是60fps
standard: 30,
high: 60,
ultra: 60
};
config.videoQuality.maxFramerateForQualityLvl = {
low: 30,
standard: 30,
high: 30,
ultra: 30
};
// ========================================
// 分辨率档位配置(所有档位都是1080P)
// ========================================
config.videoQuality.minHeightForQualityLvl = {
low: 1080,
standard: 1080,
high: 1080,
ultra: 1080
};
config.videoQuality.maxHeightForQualityLvl = {
low: 1080,
standard: 1080,
high: 1080,
ultra: 1080
};
// 禁用视频质量自动降级
config.disableVideoSuspendBelowVideoQuality = true;
config.enableLayerSuspension = false;
config.enableSimulcast = false;
// Last N无限制
config.channelLastN = 3;
videobridge {
# HTTP 服务器配置
http-servers {
public {
port = 9090
}
}
# WebSocket 配置
websockets {
enabled = true
tls = true
server-id = "default-id"
}
# 负载管理 - 可以禁用,但建议保留基本保护
load-management {
# 禁用自动降级
reducer {
enabled = false
}
}
# ICE 配置
ice {
udp {
port = 10000
}
# 如果手机连接有问题,可以启用 TCP
# tcp {
# enabled = true
# port = 4443
# }
}
}
JMT 配置 - 这是关键部分
jmt {
# 带宽估算配置
bwe {
# 带宽估算器引擎
estimator {
engine = "GoogleCc2" # 最新的带宽估算算法
}
# 发送端配置
send-side {
# 初始带宽 - 手机建议 5-10Mbps
initial-bitrate-bps = 6000000
# 最小带宽 - 不要设太高,手机网络波动大
min-bitrate-bps = 500000
# 最大带宽 - 20Mbps 对手机够用了
max-bitrate-bps = 20000000
}
}
# 传输层配置
transceiver {
recv {
# 接收队列大小
queue-size = 1024
}
send {
# 发送队列大小
queue-size = 1024
}
}
# SCTP 配置(用于数据通道)
sctp {
enabled = true
}
}