Steg 1: Kloning av repo
- Klon repoet fra GitHub ved å kjøre følgende kommando:
git clone https://github.com/EpicGamesExt/PixelStreamingInfrastructure
Steg 2: Start av Signalling Web Server
- Naviger til mappen for Signalling Web Server:
- For Linux/Mac:
cd /PixelStreamingInfrastructure/SignallingWebServer/Platform_scripts/bash ./start.sh - For Windows:
cd /PixelStreamingInfrastructure/SignallingWebServer/Platform_scripts/cmd start.bat
- For Linux/Mac:
Steg 3: Konfigurering av config.json
- Åpne filen
config.jsoni/SignallingWebServerog rediger følgende linjer:- Endre
http_root, som er satt tild:, til å peke til mappen/SignallingWebServer/www/. - Hvis du ikke ønsker GUI-overlay, endre
homepagetiluiless.html. - Sett
https_redirecttilfalsedersom du planlegger å bruke det med Pixilab Blocks; ellers kan klienten oppleve 403-feil.
- Endre
Steg 4: Justering av HTML-filer
- Gå til mappen
wwwog redigeruiless.html(ellerplayer.htmlfor GUI-overlay). Kommenter ut de to feltene merket med "Optional" slik at Signalling Server ikke prøver å koble seg til internett ved oppstart.
Steg 5: Redigering av script
-
Naviger til
/SignallingWebServer/platform_scripts/og rediger:common.sh(for Linux/Mac) ellercommon.bat(for Windows).- Slett eller kommenter ut alle referanser til nettsider, slik at serveren ikke forsøker å søke etter internettforbindelse. Script skal se ut som følger (eksempelet er fra .sh):
#!/bin/bash NODE_VERSION=$(<"${SCRIPT_DIR}/../../../NODE_VERSION") # Prints the arguments and their descriptions to the console function print_usage() { echo " Script usage: start.sh [script options...] -- [server options...] Script options: --help Print this message and stop this script. --debug Run all scripts with --inspect --nosudo Run all scripts without \`sudo\` command useful for when run in containers. --verbose Enable additional logging --publicip Define public IP address for TURN server, syntax: --publicip [ip] Default value: 127.0.0.1. --turn TURN server to be used, syntax: --turn 127.0.0.1:19303 Default value: 127.0.0.1. --turn-user Sets the TURN username when using a TURN server. --turn-pass Sets the TURN password when using a TURN server. --start-turn Will launch the TURN server process. --stun STUN server to be used, syntax: --stun [stun_server] Default value: stun.local:19302 --frontend-dir Sets the output path for the frontend build --build Force a rebuild of the typescript frontend even if it already exists --rebuild Force a rebuild of everything --build-libraries Force a rebuild of shared libraries --build-wilbur Force build of wilbur --deps Force reinstall of dependencies Anything after -- is passed directly to the signalling server. Command line options might be omitted to run with defaults and it is a good practice to omit specific ones when just starting the TURN or the STUN server alone, not the whole set of scripts. " if [[ -d "${SCRIPT_DIR}/../../dist/" ]]; then pushd "${SCRIPT_DIR}/../.." echo "Server options:" npm run start -- --help popd fi exit 1 } function parse_args() { IS_DEBUG=0 NO_SUDO=0 VERBOSE=0 BUILD_LIBRARIES=0 BUILD_FRONTEND=0 BUILD_WILBUR=0 INSTALL_DEPS=0 while(($#)) ; do case "$1" in --debug ) IS_DEBUG=1; shift;; --nosudo ) NO_SUDO=1; shift;; --verbose ) VERBOSE=1; shift;; --build ) BUILD_FRONTEND=1; shift;; --rebuild ) BUILD_LIBRARIES=1; BUILD_FRONTEND=1; BUILD_WILBUR=1; shift;; --stun ) STUN_SERVER="$2"; shift 2;; --turn ) TURN_SERVER="$2"; shift 2;; --turn-user ) TURN_USER="$2"; shift 2;; --turn-pass ) TURN_PASS="$2"; shift 2;; --start-turn ) START_TURN=1; shift;; --publicip ) PUBLIC_IP="$2"; shift 2;; --frontend-dir ) FRONTEND_DIR="$(realpath "$2")"; shift 2;; --build-wilbur ) BUILD_WILBUR=1; shift;; --build-libraries ) BUILD_LIBRARIES=1; shift;; --deps ) INSTALL_DEPS=1; shift;; --help ) print_usage;; -- ) shift; break;; * ) echo "Unknown argument: $1" exit 1 ;; esac done SERVER_ARGS+=$@ if [[ ! -z "$@" ]]; then echo "Parameters being passed to server: $@" fi } function check_version() { # current_version #min_version local current="$1" local minimum="$2" if [ -z "$minimum" ] || [ "$current" = "$minimum" ]; then return 0 fi local ordered=$(printf "%s\n%s\n" "$minimum" "$current" | sort -V | head -n1) if [ "$ordered" = "$minimum" ]; then return 1 else return 2 fi } function check_and_install() { # dep_name #get_version_string #version_min #install_command local is_installed=0 echo "Checking for required $1 install" local current=$(echo $2 | sed -E 's/[^0-9.]//g') local minimum=$(echo $3 | sed -E 's/[^0-9.]//g') if [ $# -ne 4 ]; then echo "check_and_install expects 4 args (dep_name get_version_string version_min install_command) got $#" return -1 fi if [ ! -z $current ]; then echo "Current version: $current checking >= $minimum" check_version "$current" "$minimum" if [ "$?" -lt 2 ]; then echo "$1 is installed." is_installed=1 return 0 else echo "Required install of $1 not found." fi fi if [ $is_installed -ne 1 ]; then echo "$1 installation not found." # Start installation using provided command start_process $4 if [ $? -ge 1 ]; then echo "Installation of $1 failed. Please check dependencies." return -1 fi fi return 1 } function setup_node() { pushd "${SCRIPT_DIR}" > /dev/null # Setup path with locally installed node if available PATH="${SCRIPT_DIR}/node/bin:$PATH" # Navigate to project root pushd "${SCRIPT_DIR}/../../.." > /dev/null local node_version=$(node --version 2>/dev/null || echo "0.0.0") echo "Manual installation of Node.js version $NODE_VERSION is required." # If node_modules doesn't exist or the package-lock file is newer than node_modules, install dependencies if [ ! -d node_modules ] || [ ../package-lock.json -nt node_modules ] || [ "$INSTALL_DEPS" == "1" ]; then echo "Installing dependencies..." npm install fi echo "Using node version: $(node --version)" echo "Using NPM version: $(npm --version)" popd > /dev/null } function setup_libraries() { set -e if [ ! -d "${SCRIPT_DIR}/../../../Common/dist/" ] || [ "$BUILD_LIBRARIES" == "1" ]; then pushd "${SCRIPT_DIR}/../../../Common" > /dev/null echo "Building common library." npm run build:cjs popd > /dev/null fi if [ ! -d "${SCRIPT_DIR}/../../../Signalling/dist/" ] || [ "$BUILD_LIBRARIES" == "1" ]; then pushd "${SCRIPT_DIR}/../../../Signalling" > /dev/null echo "Building signalling library." npm run build:cjs popd > /dev/null fi set +e } function setup_frontend() { set -e if [[ -z "$FRONTEND_DIR" ]]; then FRONTEND_DIR="${SCRIPT_DIR}/../../www" fi export WEBPACK_OUTPUT_PATH="${FRONTEND_DIR}" # Navigate to root pushd "${SCRIPT_DIR}/../../.." > /dev/null # If the output path doesn't exist or if --build was passed, rebuild frontend if [ ! -d "${WEBPACK_OUTPUT_PATH}" ] || [ "$BUILD_FRONTEND" == "1" ] ; then echo "Building Typescript Frontend." pushd "${SCRIPT_DIR}/../../../Common" > /dev/null npm run build:esm popd > /dev/null pushd "${SCRIPT_DIR}/../../../Frontend/library" > /dev/null npm run build:esm popd > /dev/null pushd "${SCRIPT_DIR}/../../../Frontend/ui-library" > /dev/null npm run build:esm popd > /dev/null pushd "${SCRIPT_DIR}/../../../Frontend/implementations/typescript" > /dev/null npm run build:dev popd > /dev/null else echo "Skipping building Frontend because files already exist. Please run with '--build' to force a rebuild." fi popd > /dev/null set +e } function setup_coturn() { echo "Please ensure coTURN is manually installed and configured." } function setup() { echo "Checking Pixel Streaming Server dependencies." setup_node setup_libraries setup_frontend setup_coturn } # Configure TURN and STUN servers # Prints out the configuration for the server function print_config() { echo "" echo "Running with config:" echo "Public IP address : ${PUBLIC_IP:-127.0.0.1}" if [[ -n "${STUN_SERVER}" ]]; then echo "STUN server : ${STUN_SERVER}" ; fi if [[ -n "${TURN_SERVER}" ]]; then echo "TURN server : ${TURN_SERVER}" ; fi echo "Server command line arguments: ${SERVER_ARGS}" echo "" } # launches a process conditionally removing sudo function start_process() { if [[ "${NO_SUDO}" == 1 ]]; then eval $(echo "$@" | sed 's/sudo//g') else eval "$@" fi } # Function to build wilbur if needed function build_wilbur() { if [ ! -d "${SCRIPT_DIR}/../../dist" ] || [ "$BUILD_WILBUR" == "1" ] ; then pushd "${SCRIPT_DIR}/../.." > /dev/null echo "Building wilbur." npm run build popd > /dev/null fi } # Function to start wilbur signalling server function start_wilbur() { pushd "${SCRIPT_DIR}/../../../SignallingWebServer" > /dev/null echo "Starting wilbur signalling server. Use ctrl-c to exit." echo "----------------------------------" start_process "sudo env \"PATH=$PATH\" npm start -- ${SERVER_ARGS}" popd > /dev/null } # Main setup procedure setup print_config setup_turn_stun build_wilbur start_wilbur
Kjør deretter:
./start.sh # for Linux/Mac start.bat # for Windows
Steg 6: Start av Unreal-prosjektet
- Serveren kjører nå på port
8888. Start Unreal-prosjektet du ønsker å streame med følgende argument for å peke til signalling server på local host:-PixelStreamingUrl=ws://127.0.0.1:8888
Start med det ekstra argumentet -RenderOffScreen dersom du ikke ønsker å ha grafikk kjørende på servermaskinen.
Eller finn scriptet navn_på_3dprosjekt.sh i navn_på_3dprosjekt/Binaries/Linux og legg til dette, og kjør 3d-prosjektet ved å kjøre dette scriptet.
Steg 7: Tilgang til stream
- Prosjektet er nå klart for streaming. Sørg for at port
80er åpen inn mot serveren (kan åpnes i UFW). Pek klientmaskinen til serverens IP-adresse på port80.