church_archive_script/Script.ps1

40 lines
1.2 KiB
PowerShell
Raw Normal View History

2023-11-29 16:12:35 +00:00
param ( [string[]] $Paths )
Write-Host ""
2023-11-29 16:47:01 +00:00
cd Programs
2023-11-29 16:12:35 +00:00
$Paths | foreach {
$Path = $_
$WithoutExtension = [IO.Path]::ChangeExtension($Path, '')
$ScriptFile = $WithoutExtension + "script.vpy"
$ArchiveFile = $WithoutExtension + "archive.mkv"
Write-Host "==============================================================================="
Write-Host ""
Write-Host " Input video: $Path"
Write-Host " Script file: $ScriptFile"
Write-Host " Output video: $ArchiveFile"
Write-Host ""
Write-Host ""
2023-11-29 16:47:01 +00:00
(Get-Content ..\template.vpy).replace('[INPUTFILE]', $Path.replace('\', '/')) | Set-Content -LiteralPath "$ScriptFile"
2023-11-29 16:12:35 +00:00
2023-12-10 09:53:39 +00:00
.\ffmpeg.exe -hide_banner -y -f vapoursynth -i "$ScriptFile" -i "$Path" -map 0:v:0 -map 1:a:0 -c:v libx265 -profile:v main10 -crf 17.6 -x265-params "me=star:subme=5:limit-modes=1:rect=1:amp=1:max-merge=5:no-early-skip=1:bframes=16:ref=6:rc-lookahead=60:limit-refs=0:rd=6:rdoq-level=2:psy-rdoq=1.00:sao=0" -c:a copy "$ArchiveFile"
2023-11-29 16:12:35 +00:00
Remove-Item $ScriptFile
Remove-Item "$($Path).lwi"
2023-11-29 16:47:01 +00:00
cd ..
2023-11-29 16:12:35 +00:00
.\Script_Web.ps1 "$ArchiveFile"
2023-11-29 16:47:01 +00:00
cd Programs
2023-11-29 16:12:35 +00:00
Write-Host "==============================================================================="
}
2023-11-29 16:47:01 +00:00
cd ..