2022-03-20 19:01:48 +03:00
|
|
|
$ovkRoot = $args[0]
|
|
|
|
$file = $args[1]
|
|
|
|
$dir = $args[2]
|
|
|
|
$hash = $args[3]
|
|
|
|
$hashT = $hash.substring(0, 2)
|
|
|
|
$temp = [System.IO.Path]::GetTempFileName()
|
|
|
|
$temp2 = [System.IO.Path]::GetTempFileName()
|
|
|
|
|
2022-03-22 13:16:06 +03:00
|
|
|
$shell = Get-WmiObject Win32_process -filter "ProcessId = $PID"
|
|
|
|
$shell.SetPriority(16384)
|
|
|
|
|
2022-03-20 19:01:48 +03:00
|
|
|
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"
|
2022-03-22 13:16:06 +03:00
|
|
|
ffmpeg -i $temp -c:v libtheora -q:v 7 -c:a libvorbis -q:a 4 -vf scale=640x360,setsar=1:1 -y $temp2
|
2022-03-20 19:01:48 +03:00
|
|
|
|
|
|
|
Move-Item $temp2 "$dir$hashT/$hash.ogv"
|
|
|
|
Remove-Item $temp
|
2022-03-22 13:16:06 +03:00
|
|
|
Remove-Item $temp2
|