Publish Muninn OBS stream catalog

This commit is contained in:
Meta Vens 2026-06-08 21:01:33 +01:00
commit 66a3df8ad2
5 changed files with 86 additions and 6 deletions

View file

@ -2,6 +2,7 @@ param(
[string] $RavenHost = "raven",
[string] $MuninnExe = "C:\Meta\Odin\Muninn\muninn.exe",
[string] $StorePath = "C:\Meta\Odin\state\muninn.telemetry.cc",
[string] $ObsCatalogPath = "C:\Meta\Odin\state\muninn-obs-streams.tsv",
[string] $LoopbackScript = "C:\Meta\Odin\Muninn\scripts\wasapi-loopback-capture.ps1",
[string] $LogRoot = "C:\Meta\Odin\logs\muninn",
[string] $Ffmpeg = "C:\Users\Madman's Lullaby\AppData\Local\Microsoft\WinGet\Links\ffmpeg.exe",
@ -32,7 +33,7 @@ Get-CimInstance Win32_Process |
`$lines = @(
"@echo off",
"cd /d ""`$muninnDir""",
"""$MuninnExe"" activate --store ""$StorePath"" --host raven --stream muninn.raven.av.srt --target-host ""$TargetHost"" --port $Port --obs-target-host ""$ObsTargetHost"" --obs-port $ObsPort --audio-device ""$AudioDevice"" --ffmpeg ""$Ffmpeg"" --loopback-script ""$LoopbackScript"" --log-root ""$LogRoot"" 1>>""$LogRoot\muninn-activate.out.log"" 2>>""$LogRoot\muninn-activate.err.log"""
"""$MuninnExe"" activate --store ""$StorePath"" --obs-catalog ""$ObsCatalogPath"" --host raven --stream muninn.raven.av.srt --target-host ""$TargetHost"" --port $Port --obs-target-host ""$ObsTargetHost"" --obs-port $ObsPort --audio-device ""$AudioDevice"" --ffmpeg ""$Ffmpeg"" --loopback-script ""$LoopbackScript"" --log-root ""$LogRoot"" 1>>""$LogRoot\muninn-activate.out.log"" 2>>""$LogRoot\muninn-activate.err.log"""
)
Set-Content -LiteralPath `$launcher -Value `$lines -Encoding ASCII
cmd /c "schtasks /Delete /TN GameCult-Muninn-Activate /F 2>NUL"

View file

@ -1,7 +1,9 @@
param(
[string] $RavenHost = "raven",
[string] $MuninnExe = "C:\Meta\Odin\Muninn\muninn.exe",
[string] $StorePath = "C:\Meta\Odin\state\muninn.telemetry.cc"
[string] $StorePath = "C:\Meta\Odin\state\muninn.telemetry.cc",
[string] $RemoteObsCatalogPath = "C:\Meta\Odin\state\muninn-obs-streams.tsv",
[string] $LocalObsCatalogPath = "C:\Meta\Odin\state\muninn-obs-streams.tsv"
)
$ErrorActionPreference = "Stop"
@ -22,4 +24,13 @@ if (`$null -eq `$process) {
$encoded = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($remoteScript))
& ssh.exe -o BatchMode=yes -o ConnectTimeout=5 $RavenHost "powershell.exe -NoProfile -EncodedCommand $encoded"
exit $LASTEXITCODE
$healthExit = $LASTEXITCODE
if ($healthExit -eq 0) {
$localParent = Split-Path -Parent $LocalObsCatalogPath
if (-not [string]::IsNullOrWhiteSpace($localParent)) {
New-Item -ItemType Directory -Force -Path $localParent | Out-Null
}
& ssh.exe -o BatchMode=yes -o ConnectTimeout=5 $RavenHost "cmd /c type $RemoteObsCatalogPath" |
Set-Content -Encoding UTF8 -LiteralPath $LocalObsCatalogPath
}
exit $healthExit

View file

@ -2,7 +2,9 @@ param(
[string] $RavenHost = "raven",
[string] $MuninnExe = "C:\Meta\Odin\Muninn\muninn.exe",
[string] $StorePath = "C:\Meta\Odin\state\muninn.telemetry.cc",
[string] $LogRoot = "C:\Meta\Odin\logs\muninn"
[string] $ObsCatalogPath = "C:\Meta\Odin\state\muninn-obs-streams.tsv",
[string] $LogRoot = "C:\Meta\Odin\logs\muninn",
[string] $LocalObsCatalogPath = "C:\Meta\Odin\state\muninn-obs-streams.tsv"
)
$ErrorActionPreference = "Stop"
@ -24,7 +26,7 @@ New-Item -ItemType Directory -Force -Path (Split-Path -Parent "$StorePath") | Ou
`$lines = @(
"@echo off",
"cd /d ""`$muninnDir""",
"""$MuninnExe"" serve --store ""$StorePath"" --log-root ""$LogRoot"" --host raven --interval-seconds 15 1>>""$LogRoot\muninn-serve.out.log"" 2>>""$LogRoot\muninn-serve.err.log"""
"""$MuninnExe"" serve --store ""$StorePath"" --obs-catalog ""$ObsCatalogPath"" --log-root ""$LogRoot"" --host raven --interval-seconds 15 1>>""$LogRoot\muninn-serve.out.log"" 2>>""$LogRoot\muninn-serve.err.log"""
)
Set-Content -LiteralPath `$launcher -Value `$lines -Encoding ASCII
cmd /c "schtasks /Delete /TN GameCult-Muninn /F 2>NUL"
@ -34,4 +36,10 @@ cmd /c schtasks /Run /TN GameCult-Muninn
$encoded = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($remoteScript))
& ssh.exe -o BatchMode=yes -o ConnectTimeout=10 $RavenHost "powershell.exe -NoProfile -EncodedCommand $encoded"
exit $LASTEXITCODE
$restartExit = $LASTEXITCODE
if ($restartExit -eq 0) {
Start-Sleep -Seconds 2
$healthScript = Join-Path $PSScriptRoot "health-muninn.ps1"
& powershell.exe -NoProfile -ExecutionPolicy Bypass -File $healthScript -RavenHost $RavenHost -MuninnExe $MuninnExe -StorePath $StorePath -RemoteObsCatalogPath $ObsCatalogPath -LocalObsCatalogPath $LocalObsCatalogPath
}
exit $restartExit