[*] 码率配置
This commit is contained in:
@@ -28,7 +28,7 @@ public class MediaVideoProperties {
|
||||
*/
|
||||
private Format format;
|
||||
/**
|
||||
* 码率:600|1200|1500|1800
|
||||
* 码率:400|800|1200|1600
|
||||
* 码率影响画质
|
||||
*/
|
||||
private Integer bitrate;
|
||||
|
||||
@@ -73,21 +73,32 @@ module.exports = {
|
||||
// Router配置:https://mediasoup.org/documentation/v3/mediasoup/api/#RouterOptions
|
||||
routerOptions: {
|
||||
mediaCodecs: [
|
||||
// OPUS PCMA PCMU G722
|
||||
{
|
||||
kind : "audio",
|
||||
mimeType : "audio/opus",
|
||||
clockRate: 48000,
|
||||
channels : 2,
|
||||
},
|
||||
{
|
||||
kind : "audio",
|
||||
mimeType : "audio/pcmu",
|
||||
clockRate: 8000,
|
||||
channels : 1,
|
||||
},
|
||||
{
|
||||
kind : "audio",
|
||||
mimeType : "audio/pcma",
|
||||
clockRate: 8000,
|
||||
channels : 1,
|
||||
},
|
||||
{
|
||||
kind : "video",
|
||||
mimeType : "video/VP8",
|
||||
clockRate : 90000,
|
||||
parameters: {
|
||||
"x-google-start-bitrate": 1000,
|
||||
"x-google-start-bitrate": 400,
|
||||
// "x-google-min-bitrate": 800,
|
||||
// "x-google-max-bitrate": 1800,
|
||||
// "x-google-max-bitrate": 1600,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -96,9 +107,9 @@ module.exports = {
|
||||
clockRate : 90000,
|
||||
parameters: {
|
||||
"profile-id" : 2,
|
||||
"x-google-start-bitrate": 1000,
|
||||
"x-google-start-bitrate": 400,
|
||||
// "x-google-min-bitrate": 800,
|
||||
// "x-google-max-bitrate": 1800,
|
||||
// "x-google-max-bitrate": 1600,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -109,9 +120,9 @@ module.exports = {
|
||||
"packetization-mode" : 1,
|
||||
"profile-level-id" : "4d0032",
|
||||
"level-asymmetry-allowed": 1,
|
||||
"x-google-start-bitrate" : 1000,
|
||||
"x-google-start-bitrate" : 400,
|
||||
// "x-google-min-bitrate": 800,
|
||||
// "x-google-max-bitrate": 1800,
|
||||
// "x-google-max-bitrate": 1600,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -122,9 +133,9 @@ module.exports = {
|
||||
"packetization-mode" : 1,
|
||||
"profile-level-id" : "42e01f",
|
||||
"level-asymmetry-allowed": 1,
|
||||
"x-google-start-bitrate" : 1000,
|
||||
"x-google-start-bitrate" : 400,
|
||||
// "x-google-min-bitrate": 800,
|
||||
// "x-google-max-bitrate": 1800,
|
||||
// "x-google-max-bitrate": 1600,
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -154,10 +165,10 @@ module.exports = {
|
||||
announcedIp: process.env.MEDIASOUP_ANNOUNCED_IP || "127.0.0.1",
|
||||
},
|
||||
],
|
||||
initialAvailableOutgoingBitrate: 1000000,
|
||||
initialAvailableOutgoingBitrate: 400000,
|
||||
minimumAvailableOutgoingBitrate: 800000,
|
||||
maxSctpMessageSize : 262144,
|
||||
maxIncomingBitrate : 1800000,
|
||||
maxIncomingBitrate : 1600000,
|
||||
},
|
||||
// PlainTransport配置:https://mediasoup.org/documentation/v3/mediasoup/api/#PlainTransportOptions
|
||||
plainTransportOptions: {
|
||||
|
||||
@@ -1758,13 +1758,9 @@ class Taoyao {
|
||||
};
|
||||
me.push(message);
|
||||
const {
|
||||
minOutgoingBitrate,
|
||||
maxOutgoingBitrate,
|
||||
maxIncomingBitrate,
|
||||
} = config.mediasoup.webRtcTransportOptions;
|
||||
if(minOutgoingBitrate) {
|
||||
await transport.setMinOutgoingBitrate(minOutgoingBitrate);
|
||||
}
|
||||
if(maxOutgoingBitrate) {
|
||||
await transport.setMaxOutgoingBitrate(maxOutgoingBitrate);
|
||||
}
|
||||
|
||||
@@ -2793,9 +2793,9 @@ class Taoyao extends RemoteClient {
|
||||
}
|
||||
const track = videoTrack || await me.getVideoTrack();
|
||||
const codecOptions = {
|
||||
videoGoogleStartBitrate: 400,
|
||||
videoGoogleMinBitrate : 800,
|
||||
videoGoogleMaxBitrate : 1800,
|
||||
videoGoogleStartBitrate: 1000,
|
||||
videoGoogleMaxBitrate : 1600,
|
||||
};
|
||||
let codec;
|
||||
if(me.forceVP8) {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class MediaVideoProperties {
|
||||
|
||||
@Schema(title = "格式", description = "格式", example = "VP8|VP9|H264|H265")
|
||||
private Format format;
|
||||
@Schema(title = "码率", description = "码率影响画质", example = "600|1200|1500|1800")
|
||||
@Schema(title = "码率", description = "码率影响画质", example = "400|800|1200|1600")
|
||||
private Integer bitrate;
|
||||
@Schema(title = "帧率", description = "帧率影响流畅", example = "15|18|20|24|30|45")
|
||||
private Integer frameRate;
|
||||
|
||||
@@ -121,7 +121,7 @@ taoyao:
|
||||
# 4K:UD=UHD=4K
|
||||
ud-video:
|
||||
format: H264
|
||||
bitrate: 1800
|
||||
bitrate: 2000
|
||||
frame-rate: 45
|
||||
resolution: 4096*2160
|
||||
# 2K:QD=QHD=2K
|
||||
@@ -139,13 +139,13 @@ taoyao:
|
||||
# 高清视频:HD=720P
|
||||
hd-video:
|
||||
format: H264
|
||||
bitrate: 1000
|
||||
bitrate: 800
|
||||
frame-rate: 18
|
||||
resolution: 1280*720
|
||||
# 标清视频:SD=480P
|
||||
sd-video:
|
||||
format: H264
|
||||
bitrate: 800
|
||||
bitrate: 400
|
||||
frame-rate: 15
|
||||
resolution: 720*480
|
||||
# FFmpeg配置
|
||||
|
||||
Reference in New Issue
Block a user