Add Raven capture mux daemon
This commit is contained in:
parent
75ab8a8398
commit
9642a4d205
9 changed files with 946 additions and 4 deletions
80
scripts/start-raven-daemon.ps1
Normal file
80
scripts/start-raven-daemon.ps1
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
param(
|
||||
[string]$TargetHost = "10.77.0.2",
|
||||
[int]$Port = 5200,
|
||||
[int]$EvePort = 8801,
|
||||
[int]$Width = 1920,
|
||||
[int]$Height = 1080,
|
||||
[int]$Framerate = 30,
|
||||
[int]$AudioSampleRate = 48000,
|
||||
[int]$AudioChannels = 2,
|
||||
[ValidateSet("ddagrab", "gdigrab")]
|
||||
[string]$VideoCapture = "ddagrab",
|
||||
[int]$DdagrabOutputIndex = 0,
|
||||
[string]$AudioDevice = "Realtek",
|
||||
[string]$FfmpegPath = "ffmpeg",
|
||||
[string]$WasapiLoopbackPath = "",
|
||||
[string]$CultMeshCachePath = "C:\Meta\Mimir\state\raven-capture-mux.ccmp",
|
||||
[string]$LogRoot = "C:\Meta\Mimir\logs",
|
||||
[switch]$NoCultNetServer,
|
||||
[switch]$DryRun
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$repo = Split-Path -Parent $PSScriptRoot
|
||||
$project = Join-Path $repo "src\Mimir.RavenDaemon\Mimir.RavenDaemon.csproj"
|
||||
$runtimeArgs = @(
|
||||
"run",
|
||||
"--project", $project,
|
||||
"--",
|
||||
"--target-host", $TargetHost,
|
||||
"--port", $Port,
|
||||
"--eve-port", $EvePort,
|
||||
"--width", $Width,
|
||||
"--height", $Height,
|
||||
"--framerate", $Framerate,
|
||||
"--audio-sample-rate", $AudioSampleRate,
|
||||
"--audio-channels", $AudioChannels,
|
||||
"--video-capture", $VideoCapture,
|
||||
"--ddagrab-output-index", $DdagrabOutputIndex,
|
||||
"--audio-device", $AudioDevice,
|
||||
"--ffmpeg", $FfmpegPath,
|
||||
"--cultmesh-cache", $CultMeshCachePath,
|
||||
"--log-root", $LogRoot
|
||||
)
|
||||
|
||||
if (-not [string]::IsNullOrWhiteSpace($WasapiLoopbackPath)) {
|
||||
$runtimeArgs += @("--wasapi-loopback", $WasapiLoopbackPath)
|
||||
}
|
||||
|
||||
if ($NoCultNetServer) {
|
||||
$runtimeArgs += "--no-cultnet-server"
|
||||
}
|
||||
|
||||
if ($DryRun) {
|
||||
$runtimeArgs += "--dry-run"
|
||||
& dotnet @runtimeArgs
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $LogRoot | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path -Parent $CultMeshCachePath) | Out-Null
|
||||
$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
|
||||
$stdoutLog = Join-Path $LogRoot "mimir-raven-daemon-$timestamp.out.log"
|
||||
$stderrLog = Join-Path $LogRoot "mimir-raven-daemon-$timestamp.err.log"
|
||||
|
||||
$process = Start-Process `
|
||||
-FilePath "dotnet" `
|
||||
-ArgumentList $runtimeArgs `
|
||||
-WindowStyle Hidden `
|
||||
-RedirectStandardOutput $stdoutLog `
|
||||
-RedirectStandardError $stderrLog `
|
||||
-PassThru
|
||||
|
||||
Write-Host "Started Mimir.RavenDaemon pid=$($process.Id)"
|
||||
Write-Host " Eve/CultMesh: ws://0.0.0.0:${EvePort}/eve/deck"
|
||||
Write-Host " Health: http://127.0.0.1:${EvePort}/health"
|
||||
Write-Host " Target: srt://${TargetHost}:${Port}"
|
||||
Write-Host " CultMesh cache: $CultMeshCachePath"
|
||||
Write-Host " stdout: $stdoutLog"
|
||||
Write-Host " stderr: $stderrLog"
|
||||
Loading…
Reference in a new issue