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