From e3312cb5f2f48295ca8023e838e43b5845b0ac77 Mon Sep 17 00:00:00 2001 From: celestora Date: Tue, 22 Mar 2022 12:16:06 +0200 Subject: [PATCH] Replace invalid Start-Process command with SetPriority --- Web/Models/shell/processVideo.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Web/Models/shell/processVideo.ps1 b/Web/Models/shell/processVideo.ps1 index 8e87442e..4ad382dd 100644 --- a/Web/Models/shell/processVideo.ps1 +++ b/Web/Models/shell/processVideo.ps1 @@ -6,12 +6,15 @@ $hashT = $hash.substring(0, 2) $temp = [System.IO.Path]::GetTempFileName() $temp2 = [System.IO.Path]::GetTempFileName() +$shell = Get-WmiObject Win32_process -filter "ProcessId = $PID" +$shell.SetPriority(16384) + Move-Item $file $temp # video stub logic was implicitly deprecated, so we start processing at once ffmpeg -i $temp -ss 00:00:01.000 -vframes 1 "$dir$hashT/$hash.gif" -start /B /Low /Wait /Shared ffmpeg -i $temp -c:v libtheora -q:v 7 -c:a libvorbis -q:a 4 -vf scale=640x360,setsar=1:1 -y $temp2 +ffmpeg -i $temp -c:v libtheora -q:v 7 -c:a libvorbis -q:a 4 -vf scale=640x360,setsar=1:1 -y $temp2 Move-Item $temp2 "$dir$hashT/$hash.ogv" Remove-Item $temp -Remove-Item $temp2 \ No newline at end of file +Remove-Item $temp2