Skip to content

flarexio/game

Repository files navigation

Edge Gaming

Build Requirements

Prerequisites

To build this project, you need to install the following tools:

  1. C Compiler: LLVM-mingw

  2. CMake

  3. Ninja

  4. MSYS2 (for OpenSSL dependency)

    • Download from: https://www.msys2.org/
    • Required because moonlight-common-c depends on OpenSSL, which is not included in the minimal LLVM-mingw distribution

Setup Instructions

  1. Install LLVM-mingw (UCRT version) and add it to your PATH
  2. Install CMake and add it to your PATH
  3. Install Ninja and add it to your PATH
  4. Install MSYS2 and install OpenSSL (UCRT version):
    pacman -S --needed mingw-w64-ucrt-x86_64-openssl mingw-w64-ucrt-x86_64-pkg-config
  5. Add MSYS2's UCRT64 bin directory to your PATH (e.g., C:\msys64\ucrt64\bin)

Build

  1. Clone the repository and initialize submodules:

    git clone https://github.com/flarexio/game.git
    cd game
    git submodule update --init --recursive
  2. Build opus (PowerShell):

    cd thirdparty/opus
    
    # Configure and build
    mkdir build; cd build
    cmake -G "Ninja" -S .. -B . `
      -DCMAKE_BUILD_TYPE=Release `
      -DOPUS_BUILD_SHARED_LIBRARY=ON `
      -DOPUS_BUILD_TESTING=OFF `
      -DOPUS_BUILD_PROGRAMS=OFF `
      -DCMAKE_C_COMPILER=clang `
      -DCMAKE_C_COMPILER_TARGET=x86_64-w64-mingw32
    
    cmake --build . --parallel
  3. Build moonlight-common-c (PowerShell):

    cd thirdparty/moonlight-common-c
    
    # Set environment variables
    $env:CC = "clang"
    $env:CXX = "clang++"
    $env:OPENSSL_ROOT_DIR = "C:/msys64/ucrt64"
    $env:CMAKE_PREFIX_PATH = "C:/msys64/ucrt64"
    $env:PATH = "C:\msys64\ucrt64\bin;$env:PATH"
    
    # Configure and build
    mkdir build; cd build
    cmake -G "Ninja" -S .. -B . `
      -DCMAKE_BUILD_TYPE=Release `
      -DBUILD_SHARED_LIBS=ON `
      -DCMAKE_C_COMPILER=clang `
      -DCMAKE_RC_COMPILER=llvm-rc `
      -DCMAKE_C_COMPILER_TARGET=x86_64-w64-mingw32 `
      -DOPENSSL_ROOT_DIR="C:/msys64/ucrt64" `
      -DOPENSSL_USE_STATIC_LIBS=OFF
    
    cmake --build . --parallel
  4. Set up runtime environment:

    Before running the application, ensure the following paths are in your PATH environment variable:

    • thirdparty\opus\build (for opus.dll)
    • thirdparty\moonlight-common-c\build (for moonlight-common-c.dll)
    • C:\msys64\ucrt64\bin (for OpenSSL DLLs: libssl-3-x64.dll, libcrypto-3-x64.dll)
  5. Build the project:

    # Build commands here

Sample Video

ffmpeg -re -stream_loop -1 -i input.mp4 \
  -map 0:v -c:v copy -an -f h264 unix:///tmp/stream/video.sock \
  -map 0:a -vn -c:a libopus -ac 2 -page_duration 20000 -f ogg unix:///tmp/stream/audio.sock

Edge Gaming

# ffmpeg -hide_banner -h encoder=h264_nvenc
ffmpeg -init_hw_device d3d11va -filter_complex "ddagrab=0:offset_x=1280:offset_y=720:video_size=1280x720:framerate=60" -c:v h264_nvenc -preset p1 -tune ull -f h264 tcp://localhost:3000

# ffmpeg -hide_banner -list_devices true -f dshow -i dummy
# ffmpeg -hide_banner -h encoder=libopus
ffmpeg -f dshow -i audio="立體聲混音 (Realtek High Definition Audio)" -ac 2 -c:a libopus -b:a 64k -application lowdelay -page_duration 2000 -f opus tcp://localhost:3002

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors