[*] 日常优化

This commit is contained in:
acgist
2023-06-19 09:01:36 +08:00
parent 5a4aa469e1
commit 3b232a1c3f
3 changed files with 46 additions and 46 deletions

View File

@@ -1,13 +1,13 @@
{ {
"apps": [ "apps": [
{ {
"cwd": "./", "cwd" : "./",
"name": "taoyao-client-media", "name" : "taoyao-client-media",
"script": "src/Server.js", "script" : "src/Server.js",
"instances": 2, "instances" : 2,
"exec_mode": "cluster", "exec_mode" : "cluster",
"out_file": "./logs/out.log", "out_file" : "./logs/out.log",
"error_file": "./logs/error.log", "error_file" : "./logs/error.log",
"log_date_format": "YYYY-MM-DD HH:mm:ss" "log_date_format": "YYYY-MM-DD HH:mm:ss"
} }
] ]

View File

@@ -1,11 +1,11 @@
{ {
"apps": [ "apps": [
{ {
"cwd": "./", "cwd" : "./",
"name": "taoyao-client-media", "name" : "taoyao-client-media",
"script": "src/Server.js", "script" : "src/Server.js",
"out_file": "./logs/out.log", "out_file" : "./logs/out.log",
"error_file": "./logs/error.log", "error_file" : "./logs/error.log",
"log_date_format": "YYYY-MM-DD HH:mm:ss" "log_date_format": "YYYY-MM-DD HH:mm:ss"
} }
] ]

View File

@@ -74,15 +74,15 @@ module.exports = {
mediaCodecs: [ mediaCodecs: [
// OPUS PCMA PCMU G722 // OPUS PCMA PCMU G722
{ {
kind: "audio", kind : "audio",
mimeType: "audio/opus", mimeType : "audio/opus",
clockRate: 48000, clockRate: 48000,
channels: 2, channels : 2,
}, },
{ {
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": 1000,
// "x-google-min-bitrate": 800, // "x-google-min-bitrate": 800,
@@ -90,38 +90,38 @@ module.exports = {
}, },
}, },
{ {
kind: "video", kind : "video",
mimeType: "video/VP9", mimeType : "video/VP9",
clockRate: 90000, clockRate : 90000,
parameters: { parameters: {
"profile-id": 2, "profile-id" : 2,
"x-google-start-bitrate": 1000, "x-google-start-bitrate": 1000,
// "x-google-min-bitrate": 800, // "x-google-min-bitrate": 800,
// "x-google-max-bitrate": 1800, // "x-google-max-bitrate": 1800,
}, },
}, },
{ {
kind: "video", kind : "video",
mimeType: "video/h264", mimeType : "video/h264",
clockRate: 90000, clockRate : 90000,
parameters: { parameters: {
"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" : 1000,
// "x-google-min-bitrate": 800, // "x-google-min-bitrate": 800,
// "x-google-max-bitrate": 1800, // "x-google-max-bitrate": 1800,
}, },
}, },
{ {
kind: "video", kind : "video",
mimeType: "video/h264", mimeType : "video/h264",
clockRate: 90000, clockRate : 90000,
parameters: { parameters: {
"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" : 1000,
// "x-google-min-bitrate": 800, // "x-google-min-bitrate": 800,
// "x-google-max-bitrate": 1800, // "x-google-max-bitrate": 1800,
}, },
@@ -132,15 +132,15 @@ module.exports = {
webRtcServerOptions: { webRtcServerOptions: {
listenInfos: [ listenInfos: [
{ {
protocol: "udp", protocol : "udp",
ip: process.env.MEDIASOUP_LISTEN_IP || "0.0.0.0", ip : process.env.MEDIASOUP_LISTEN_IP || "0.0.0.0",
port: 44444, port : 44444,
announcedIp: process.env.MEDIASOUP_ANNOUNCED_IP || defaultTaoyaoHost || "127.0.0.1", announcedIp: process.env.MEDIASOUP_ANNOUNCED_IP || defaultTaoyaoHost || "127.0.0.1",
}, },
{ {
protocol: "tcp", protocol : "tcp",
ip: process.env.MEDIASOUP_LISTEN_IP || "0.0.0.0", ip : process.env.MEDIASOUP_LISTEN_IP || "0.0.0.0",
port: 44444, port : 44444,
announcedIp: process.env.MEDIASOUP_ANNOUNCED_IP || defaultTaoyaoHost || "127.0.0.1", announcedIp: process.env.MEDIASOUP_ANNOUNCED_IP || defaultTaoyaoHost || "127.0.0.1",
}, },
], ],
@@ -149,19 +149,19 @@ module.exports = {
webRtcTransportOptions: { webRtcTransportOptions: {
listenIps: [ listenIps: [
{ {
ip: process.env.MEDIASOUP_LISTEN_IP || "0.0.0.0", ip : process.env.MEDIASOUP_LISTEN_IP || "0.0.0.0",
announcedIp: process.env.MEDIASOUP_ANNOUNCED_IP || defaultTaoyaoHost || "127.0.0.1", announcedIp: process.env.MEDIASOUP_ANNOUNCED_IP || defaultTaoyaoHost || "127.0.0.1",
}, },
], ],
initialAvailableOutgoingBitrate: 1000000, initialAvailableOutgoingBitrate: 1000000,
minimumAvailableOutgoingBitrate: 800000, minimumAvailableOutgoingBitrate: 800000,
maxSctpMessageSize: 262144, maxSctpMessageSize : 262144,
maxIncomingBitrate: 1800000, maxIncomingBitrate : 1800000,
}, },
// PlainTransport配置https://mediasoup.org/documentation/v3/mediasoup/api/#PlainTransportOptions // PlainTransport配置https://mediasoup.org/documentation/v3/mediasoup/api/#PlainTransportOptions
plainTransportOptions: { plainTransportOptions: {
listenIp: { listenIp: {
ip: process.env.MEDIASOUP_LISTEN_IP || "0.0.0.0", ip : process.env.MEDIASOUP_LISTEN_IP || "0.0.0.0",
announcedIp: process.env.MEDIASOUP_ANNOUNCED_IP || defaultTaoyaoHost || "127.0.0.1", announcedIp: process.env.MEDIASOUP_ANNOUNCED_IP || defaultTaoyaoHost || "127.0.0.1",
}, },
maxSctpMessageSize: 262144, maxSctpMessageSize: 262144,
@@ -170,8 +170,8 @@ module.exports = {
}; };
/** /**
* PipeTransport: RTP(router) * PipeTransport : RTP(router)
* PlainTransport: RTP * PlainTransport : RTP
* DirectTransport: NodeJS * DirectTransport: NodeJS
* WebRtcTransport: WebRTC * WebRtcTransport: WebRTC
*/ */