当前位置:网站首页>win10下mediasoup搭建过程中的一些坑记录
win10下mediasoup搭建过程中的一些坑记录
2022-08-04 05:32:00 【睏哥RTC】
我们原来基于Janus的webrtc系统基本上可用了,系统目前最高到5万人同时在线,不过确实发现Janus的一些不足,对于我这种喜欢c++的人来说,看Janus的代码实在是比较痛苦,于是处于研究目的,研究下Medooze,Mediasoup等,比较下来Medooze服务端不支持windows平台(因我一些原因我需要在windows 下搭建),Mediasoup的框架和代码风格看的最让人舒爽,易懂好维护,性能好,下面记录的是Mediasoup学习过程中碰到的一些坑。
其实主要因为对node不熟导致的坑,记一下,也许对同样的新学者有用,
错误一:npm install 错误
Error: Unknown platform: win32
at Object.<anonymous> (E:\code\mediasoup-demo\server\node_modules\clang-tools-prebuilt\install.js:24:33)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\clang-tools-prebuilt):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] postinstall: `node install.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1这个google海外找也没找到解决方法,最后用 npm install --ignore-scripts 通过, 不知道有没有影响
错误二: npm start 错误提示:'DEBUG' 不是内部或外部命令,也不是可运行的程序
解决办法,改为如下方式启动:
set DEBUG=${DEBUG:='*mediasoup* *INFO* *WARN* *ERROR*'} INTERACTIVE=${INTERACTIVE:='true'}
node server.js
错误三:启动WEB APP错误:error Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style
解决:修改.eslintrc.js 文件 'linebreak-style': [ 2, 'windows' ],
错误四:mediasoup throwing MediaSoupTypeError: invalid IP 'localhost'
解决:服务器端config.js配置问题,注意我只是本机测试
const os = require('os');
module.exports =
{
// Listening hostname (just for `gulp live` task).
domain : 'localhost',
// Signaling settings (protoo WebSocket server and HTTP API server).
https :
{
listenIp : '0.0.0.0',
// NOTE: Don't change listenPort (client app assumes 4443).
listenPort : process.env.PROTOO_LISTEN_PORT || 4443,
// NOTE: Set your own valid certificate files.
tls :
{
cert : process.env.HTTPS_CERT_FULLCHAIN || `${__dirname}/certs/fullchain.pem`,
key : process.env.HTTPS_CERT_PRIVKEY || `${__dirname}/certs/privkey.pem`
}
},
// mediasoup settings.
mediasoup :
{
// Number of mediasoup workers to launch.
numWorkers : Object.keys(os.cpus()).length,
// mediasoup WorkerSettings.
// See https://mediasoup.org/documentation/v3/mediasoup/api/#WorkerSettings
workerSettings :
{
logLevel : 'warn',
logTags :
[
'info',
'ice',
'dtls',
'rtp',
'srtp',
'rtcp',
'rtx',
'bwe',
'score',
'simulcast',
'svc',
'sctp'
],
rtcMinPort : process.env.MEDIASOUP_MIN_PORT || 40000,
rtcMaxPort : process.env.MEDIASOUP_MAX_PORT || 49999
},
// mediasoup Router options.
// See https://mediasoup.org/documentation/v3/mediasoup/api/#RouterOptions
routerOptions :
{
mediaCodecs :
[
{
kind : 'audio',
mimeType : 'audio/opus',
clockRate : 48000,
channels : 2
},
{
kind : 'video',
mimeType : 'video/VP8',
clockRate : 90000,
parameters :
{
'x-google-start-bitrate' : 1000
}
},
{
kind : 'video',
mimeType : 'video/VP9',
clockRate : 90000,
parameters :
{
'profile-id' : 2,
'x-google-start-bitrate' : 1000
}
},
{
kind : 'video',
mimeType : 'video/h264',
clockRate : 90000,
parameters :
{
'packetization-mode' : 1,
'profile-level-id' : '4d0032',
'level-asymmetry-allowed' : 1,
'x-google-start-bitrate' : 1000
}
},
{
kind : 'video',
mimeType : 'video/h264',
clockRate : 90000,
parameters :
{
'packetization-mode' : 1,
'profile-level-id' : '42e01f',
'level-asymmetry-allowed' : 1,
'x-google-start-bitrate' : 1000
}
}
]
},
// mediasoup WebRtcTransport options for WebRTC endpoints (mediasoup-client,
// libmediasoupclient).
// See https://mediasoup.org/documentation/v3/mediasoup/api/#WebRtcTransportOptions
webRtcTransportOptions :
{
listenIps :
[
{
ip : '192.168.2.100',
announcedIp : null
}
],
initialAvailableOutgoingBitrate : 1000000,
minimumAvailableOutgoingBitrate : 600000,
maxSctpMessageSize : 262144,
// Additional options that are not part of WebRtcTransportOptions.
maxIncomingBitrate : 1500000
},
// mediasoup PlainTransport options for legacy RTP endpoints (FFmpeg,
// GStreamer).
// See https://mediasoup.org/documentation/v3/mediasoup/api/#PlainTransportOptions
plainTransportOptions :
{
listenIp :
{
ip : '192.168.2.100',
announcedIp : null
},
maxSctpMessageSize : 262144
}
}
};
其他对新学者可能有用的信息:
1. mediasoup使用ortc接口,用的不是目前webrtc那套sdp交换机制,虽然ortc说是webrtc的下一代接口,好几年前google就号称要支持ortc,但是目前也查不到chrome支持ortc的记录,倒是微软的edge曾经支持过ortc接口,所以用mediasoup的话,无论是web还是win,ios,android都要用mediasoup封装的客户端库
边栏推荐
- The second official example analysis of the MOOSE platform - about creating a Kernel and solving the convection-diffusion equation
- MNIST handwritten digit recognition, sorted by from two to ten
- Rules.make-适合在编辑模式下看
- Amazon Cloud Technology Build On-Amazon Neptune's Knowledge Graph-Based Recommendation Model Building Experience
- A code example of the PCL method in the domain of DG (Domain Generalization)
- Question 1000: Input two integers a and b, calculate the sum of a+b, this question is multiple sets of test data
- MNIST Handwritten Digit Recognition - Building a Perceptron from Zero for Two-Classification
- 库函数的模拟实现-C语言
- 文件权限管理 ugo
- 文件编辑器
猜你喜欢

MySQL基础

(位操作符)按位与、按位或、按位异或

通用解决端口占用问题

Fabric v1.1 环境搭建

Install Minikube Cluster in AWS-EC2

Shell脚本执行的三种方式

file permission management ugo

Copy Siege Lion 5-minute online experience MindIR format model generation

Brief description of database and common operation guide

AWS使用EC2降低DeepRacer的训练成本:DeepRacer-for-cloud的实践操作
随机推荐
FAREWARE ADDRESS
Deep Learning Theory - Overfitting, Underfitting, Regularization, Optimizers
Amazon Cloud Technology Build On 2022 - AIot Season 2 IoT Special Experiment Experience
C语言数组的深度分析
集合---ArrayList的底层
线性表之动态数组(ArrayList)的自实现
C语言静态变量static的分析
sbl_init.asm-适合在编辑模式下看
Implementation of CAS lock-free queue
C语言结构体(必须掌握版)
[日常办公][shell]常用代码段
2020-03-27
[日常办公][ssh]cheatsheet
JDBC第一学之进行数据库连接时出现The server time zone.....解决办法
使用JS在浏览器中打印菱形
Tencent and NetEase have taken action one after another. What is the metaverse that is so popular that it is out of the circle?
file permission management ugo
MySQL存储过程学习笔记(基于8.0)
const int * a 与 int * const a 的定义与区别
【c语言】整数的二进制表现形式是什么?