Files
UnrealEngineUWP/Samples/PixelStreaming/WebServers/SFU/config.js
Luke Bermingham a7599949b7 Update Samples/PixelStreaming with early work from 5.1. (Multiple authors)
*************
Features
*************
- Added stat in stats panel to show currently used audio/video codec.
- Added audio bitrate in the stats panel.
- Added toggle in the settings panel to force mono audio.
- Added new info in stats panel to indicate input controlling mode.
- Added Linux platform scripts for the Matchmaker/SFU.
- Added npm commands for signalling server. `npm run $config -- $args` which will work across platforms (`$config` might be `start-signalling-server` and args might be `--debug`)

*************
Bugfixes
*************
- Fix matchmaker taking up to 45 seconds to display a valid server for use.
- Fix regression where all browser audio was mono (default now stereo).
- Fix Linux SFU and Signalling Server scripts not grabbing the public IP correctly.
- Fix linux setup scripts not working when being run from a location that has a space in the path.
- Fix SFU run_cloud.bat tries to call non-existent run.bat.
- Fix being unable to type in console of a streamed application.
- Fix docker scripts running only TURN when we needed both TURN and cirrus.
- Fix docker scripts not starting correctly.

*************
Refactors
*************
- Bash scripts have been refactored for readability.

#rb self
#fyi Mattias.Jansson, Aidan.Possemiers
#preflight https://horde.devtools.epicgames.com/job/628c894f5665463c21effaa9

[CL 20345056 by Luke Bermingham in ue5-main branch]
2022-05-24 03:43:51 -04:00

109 lines
2.7 KiB
JavaScript

// Parse passed arguments
let passedPublicIP = null;
for(let arg of process.argv){
if(arg && arg.startsWith("--PublicIP=")){
let splitArr = arg.split("=");
if(splitArr.length == 2){
passedPublicIP = splitArr[1];
console.log("--PublicIP=" + passedPublicIP);
}
}
}
const config = {
signallingURL: "ws://localhost:8889",
mediasoup: {
worker: {
rtcMinPort: 40000,
rtcMaxPort: 49999,
logLevel: "debug",
logTags: [
"info",
"ice",
"dtls",
"rtp",
"srtp",
"rtcp",
"sctp"
// 'rtx',
// 'bwe',
// 'score',
// 'simulcast',
// 'svc'
],
},
router: {
mediaCodecs: [
{
kind: "audio",
mimeType: "audio/opus",
clockRate: 48000,
channels: 2,
},
{
kind: 'video',
mimeType: 'video/VP8',
clockRate: 90000,
parameters: {
"packetization-mode": 1,
"profile-level-id": "42e01f",
"level-asymmetry-allowed": 1
}
},
{
kind: "video",
mimeType: "video/h264",
clockRate: 90000,
parameters: {
"packetization-mode": 1,
"profile-level-id": "42e01f",
"level-asymmetry-allowed": 1
},
},
],
},
// here you must specify ip addresses to listen on
// some browsers have issues with connecting to ICE on
// localhost so you might have to specify a proper
// private or public ip here.
webRtcTransport: {
listenIps: passedPublicIP != null ? [{ ip: "0.0.0.0", announcedIp: passedPublicIP}] : getLocalListenIps(),
// 100 megabits
initialAvailableOutgoingBitrate: 100_000_000,
},
},
}
function getLocalListenIps() {
const listenIps = []
if (typeof window === 'undefined') {
const os = require('os')
const networkInterfaces = os.networkInterfaces()
const ips = []
if (networkInterfaces) {
for (const [key, addresses] of Object.entries(networkInterfaces)) {
addresses.forEach(address => {
if (address.family === 'IPv4') {
listenIps.push({ ip: address.address, announcedIp: null })
}
/* ignore link-local and other special ipv6 addresses.
* https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml
*/
else if (address.family === 'IPv6' && address.address[0] !== 'f') {
listenIps.push({ ip: address.address, announcedIp: null })
}
})
}
}
}
if (listenIps.length === 0) {
listenIps.push({ ip: '127.0.0.1', announcedIp: null })
}
return listenIps
}
module.exports = config;