Mediasoup-demo部署后无法看到对方的视频

来源:13-2 Mediasoup Demo的布署

幕布斯7419438

2020-08-31

如题,部署在阿里云机器上,config.js的配置如下

/**

  • IMPORTANT (PLEASE READ THIS):
  • This is not the “configuration file” of mediasoup. This is the configuration
  • file of the mediasoup-demo app. mediasoup itself is a server-side library, it
  • does not read any “configuration file”. Instead it exposes an API. This demo
  • application just reads settings from this file (once copied to config.js) and
  • calls the mediasoup API with those settings when appropriate.
    */

const os = require(‘os’);

module.exports =
{
domain : process.env.DOMAIN || ‘127.0.0.1’,
https :
{
listenIp : ‘0.0.0.0’,
listenPort : process.env.PROTOO_LISTEN_PORT || 4443,
tls :
{
cert : process.env.HTTPS_CERT_FULLCHAIN || ${__dirname}/certs/fullchain.pem,
key : process.env.HTTPS_CERT_PRIVKEY || ${__dirname}/certs/prikey.key
}
},
mediasoup :
{
numWorkers : Object.keys(os.cpus()).length,
workerSettings :
{
logLevel : ‘warn’,
logTags :
[
‘info’,
‘ice’,
‘dtls’,
‘rtp’,
‘srtp’,
‘rtcp’,
‘rtx’,
‘bwe’,
‘score’,
‘simulcast’,
‘svc’,
‘sctp’
],
rtcMinPort : process.env.MEDIASOUP_MIN_PORT || 10000,
rtcMaxPort : process.env.MEDIASOUP_MAX_PORT || 15000
},

	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
				}
			}
		]
	},

	webRtcTransportOptions :
	{
		listenIps :
		[
			{
				ip          : process.env.MEDIASOUP_LISTEN_IP || '172.18.91.244',
				announcedIp : null			}
		],
		initialAvailableOutgoingBitrate : 1000000,
		minimumAvailableOutgoingBitrate : 600000,
		maxSctpMessageSize              : 262144,
		// Additional options that are not part of WebRtcTransportOptions.
		maxIncomingBitrate              : 1500000
	},
	plainTransportOptions :
	{
		listenIp :
		{
			ip          : process.env.MEDIASOUP_LISTEN_IP || '0.0.0.0',
			announcedIp : '0.0.0.0' || process.env.MEDIASOUP_ANNOUNCED_IP
		},
		maxSctpMessageSize : 262144
	}
}

};

写回答

2回答

风闲10

2021-01-12

根据我的测试,webRtcTransportOptions的ip变成0.0.0.0(127.0.0.1不行),announceIp修改成外网ip

就好了

3
0

李超

2020-09-01

进入课程群,到公告里看常见问题

0
2
幕布斯7419438
现在已进群了
2020-09-01
共2条回复

百万级高并发WebRTC流媒体服务器设计与开发

备战5G音视频时代,抢先掌握服务端高级技能

2067 学习 · 375 问题

查看课程