Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #429 from mcottontensor/new_docs
Browse files Browse the repository at this point in the history
New docs
  • Loading branch information
mcottontensor committed Nov 21, 2023
2 parents 5bea564 + bbba5e0 commit e66dacf
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ npm i @epicgames-ps/lib-pixelstreamingfrontend-ui-ue5.3

## Documentation
* [General Docs](/Docs/README.md)
* [Frontend Docs](/Frontend/)
* Signalling Server Docs [TO DO](https://github.com/EpicGames/PixelStreamingInfrastructure/issues/255)
* Matchmaker Docs [TO DO](https://github.com/EpicGames/PixelStreamingInfrastructure/issues/256)
* SFU Docs [TO DO](https://github.com/EpicGames/PixelStreamingInfrastructure/issues/257)
* [Frontend Docs](/Frontend/README.md)
* [Signalling Server Docs](/SignallingWebServer/README.md)
* [Matchmaker Docs](/Matchmaker/README.md)
* [SFU Docs](/SFU/README.md)

### Tagged source releases + built typescript frontend

Expand Down
59 changes: 59 additions & 0 deletions SFU/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Pixel Streaming Selective Forwarding Unit

The SFU (Selective Forwarding Unit) is a mechanism to allow distributing a single stream out to a large number of peers. This is useful because when peers connect directly to the streamer, resources must be allocated per peer to allow encoding of the stream. This means the resources can be quickly drained after only a handful of peers. The SFU can receive multiple streams using simulcast and selectively forward out streams to remote peers based on their available resources, without requiring to actually re-encode the stream.

## Configuration

Configuration is handled through the single config.js file.

| Name | Type | Default | Description |
|-|-|-|-|
| signallingURL | String | 'http://localhost:8889' | The URL pointing to the signalling server we want to connect to. |
| SFUId | String | 'SFU' | The name this peer will be given that will then be displayed in the streamer list. Peers wishing to receive from this SFU should subscribe to this ID. |
| subscribeStreamerId | String | 'DefaultStreamer' | This is the name of the streamer that this SFU should subscribe to and re-stream. |
| retrySubscribeDelaySecs | Number | 10 | If subscribing to the given streamer fails, wait this many seconds before trying again. |
| mediasoup | Object | | Mediasoup-related configuration options. See below. |

### Mediasoup related configuration options.

| Name | Type | Default | Description |
|-|-|-|-|
| worker | Object | | Worker-related configuration options. See below. |
| router | Object | | Router-related configuration options. See below. |
| webRtcTransport | Object | | WebRTC transport-related configuration options. See below. |

### Worker-related configuration options.

| Name | Type | Default | Description |
|-|-|-|-|
| rtcMinPort | Number | 40000 | Minimun RTC port for ICE, DTLS, RTP, etc. |
| rtcMaxPort | Number | 49999 | Maximum RTC port for ICE, DTLS, RTP, etc. |
| logLevel | String | 'debug' | The log level for the worker. See Mediasoup [docs](https://mediasoup.org/documentation/v3/mediasoup/api/#WorkerLogLevel) |
| logTags | Array<WorkerLogTag> | | The log tags to include in logs. See Mediasoup [docs](https://mediasoup.org/documentation/v3/mediasoup/api/#WorkerLogTag) |

### Router-related configuration options.

| Name | Type | Default | Description |
|-|-|-|-|
| mediaCodecs | Array<RtpCodecCapability> | | Codecs to support. See Mediasoup [docs](https://mediasoup.org/documentation/v3/mediasoup/rtp-parameters-and-capabilities/#RtpCodecCapability) |

### WebRTC transport-related configuration options.

| Name | Type | Default | Description |
|-|-|-|-|
| listenIps | Array<TransportListenIp|String> | | Listening IP address or addresses in order of preference (first one is the preferred one). See Mediasoup [docs](https://mediasoup.org/documentation/v3/mediasoup/api/#TransportListenIp) |
| initialAvailableOutgoingBitrate | Number | Initial available outgoing bitrate (in bps/bits per second). |

## Running

Several scripts are supplied for Windows and Linux in the [platform_scripts](platform_scripts/) folder. These are the easiest way to get the server running under common situations. They can also be used as a reference for new situations.

## Streaming from UE

The best way to fully utilize the SFU is to have a single streamer streaming simulcast to the SFU and then have peers subscribe to the SFU stream.

Launch the streaming app with the following arguments
`-SimulcastParameters="1.0,5000000,20000000,2.0,1000000,5000000,4.0,50000,1000000"`
This tells the Pixel Streaming plugin to stream simulcast with 3 streams, each one scaling video resolution by half. The sequence of values is as follows, `scale_down_factor,min_bitrate,max_bitrate,...repeating for each stream`

When this streams to the SFU, the SFU will detect these 3 streams and then selectively stream these out to connected peers based on their connection quality.
32 changes: 32 additions & 0 deletions SignallingWebServer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Pixel Streaming Signalling Server

The signalling server is a small intermediary application that sits between streamers and other peers. It handles the initial connection negotiations and some other small ongoing control messages between peers as well as acting as a simple web server for serving the [Frontend](/Frontend/README.md) web application.

## Configuration

Configuration of the signalling server is handled via the config.js file in the SignallingWebServer directory. The following are its supported options.
| Name | Type | Default | Description |
|-|-|-|-|
| UseFrontend | Boolean | false | Enables or disables the use of the Frontend. |
| UseMatchmaker | Boolean | false | Enables or disables the use of the [Matchmaker](/Matchmaker) application. |
| UseHTTPS | Boolean | false | Enables or disables ssl for the serving of the Frontend. |
| HTTPSCertFile | String | './certificates/client-cert.pem' | The path to the SSL cert file for when HTTPS is enabled. |
| HTTPSKeyFile | String | './certificates/client-key.pem' | The path to the SSL key file for when HTTPS is enabled. |
| LogToFile | Boolean | true | Enable or disable logging to a file in the 'logs' folder. |
| LogVerbose | Boolean | true | Enable or disable verbose logging. Adds a lot of extra information to logs. |
| HomepageFile | String | 'player.html' | The root file of the frontend web application. |
| AdditionalRoutes | Map | | Additional routes for the web application. |
| EnableWebserver | Boolean | true | Enables or disables the serving of the frontend through the internal web server. Disbable this if you are serving your own frontend. |
| MatchmakerAddress | String | | The IP/hostname of the matchmaker application. |
| MatchmakerPort | Number | 9999 | The port the matchmaker is listening on. |
| PublicIp | String | "localhost" | The public IP/hostname of the host that the signalling server is listening on. This is used by the matchmaker. |
| HttpPort | Number | 80 | The port for the internal webserver to listen on. |
| HttpsPort | Number | 443 | The port for the internal webserver to listen on when HTTPS is enabled. |
| StreamerPort | Number | 8888 | The port to listen on for new streamer connections. |
| SFUPort | Number | 8889 | The port to listen on for new SFU connections. |
| MaxPlayerCount | Number | -1 | A limit for connected players in total on this signalling server. -1 to disable limit. |
| DisableSSLCert | Boolean | true | When HTTPS is enabled and this is true, insecure certificates can be used. This is convenient for local testing but please DO NOT SHIP THIS IN PRODUCTION |

## Running

Several scripts are supplied for Windows and Linux in the [platform_scripts](platform_scripts/) folder. These are the easiest way to get the server running under common situations. They can also be used as a reference for new situations.
10 changes: 0 additions & 10 deletions SignallingWebServer/Readme.md

This file was deleted.

0 comments on commit e66dacf

Please sign in to comment.