From bdd222461c5f364c1dfe421d1f6849c81b886c0a Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Wed, 29 Nov 2023 16:47:01 +0000 Subject: [PATCH] Organize scripts a bit better. --- Encode.bat | 1 - Encode_Web.bat | 1 - Programs/Script.ps1 => Script.ps1 | 10 +++++++++- Programs/Script_Web.ps1 => Script_Web.ps1 | 8 +++++--- Programs/template.vpy => template.vpy | 0 5 files changed, 14 insertions(+), 6 deletions(-) rename Programs/Script.ps1 => Script.ps1 (86%) rename Programs/Script_Web.ps1 => Script_Web.ps1 (64%) rename Programs/template.vpy => template.vpy (100%) diff --git a/Encode.bat b/Encode.bat index 06ebc8e..8489735 100644 --- a/Encode.bat +++ b/Encode.bat @@ -8,7 +8,6 @@ IF '%1' == '' GOTO Done SET args=%args%,'%1' GOTO More :Done -cd Programs Powershell.exe -noprofile -command "& {.\Script.ps1 %args%}" pause exit \ No newline at end of file diff --git a/Encode_Web.bat b/Encode_Web.bat index 82222b3..6bf8697 100644 --- a/Encode_Web.bat +++ b/Encode_Web.bat @@ -8,7 +8,6 @@ IF '%1' == '' GOTO Done SET args=%args%,'%1' GOTO More :Done -cd Programs Powershell.exe -noprofile -command "& {.\Script_Web.ps1 %args%}" pause exit \ No newline at end of file diff --git a/Programs/Script.ps1 b/Script.ps1 similarity index 86% rename from Programs/Script.ps1 rename to Script.ps1 index dcca873..e5572b9 100644 --- a/Programs/Script.ps1 +++ b/Script.ps1 @@ -2,6 +2,8 @@ param ( [string[]] $Paths ) Write-Host "" +cd Programs + $Paths | foreach { $Path = $_ @@ -18,14 +20,20 @@ $Paths | foreach { Write-Host "" Write-Host "" - (Get-Content template.vpy).replace('[INPUTFILE]', $Path.replace('\', '/')) | Set-Content -LiteralPath "$ScriptFile" + (Get-Content ..\template.vpy).replace('[INPUTFILE]', $Path.replace('\', '/')) | Set-Content -LiteralPath "$ScriptFile" .\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.4 -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" Remove-Item $ScriptFile Remove-Item "$($Path).lwi" + cd .. + .\Script_Web.ps1 "$ArchiveFile" + cd Programs + Write-Host "===============================================================================" } + +cd .. diff --git a/Programs/Script_Web.ps1 b/Script_Web.ps1 similarity index 64% rename from Programs/Script_Web.ps1 rename to Script_Web.ps1 index ef73d49..f913127 100644 --- a/Programs/Script_Web.ps1 +++ b/Script_Web.ps1 @@ -1,5 +1,7 @@ param ( [string[]] $Paths ) +cd Programs + $Paths | foreach { $Path = $_ @@ -15,10 +17,10 @@ $Paths | foreach { Write-Host "" Write-Host "" - # .\ffmpeg.exe -hide_banner -y -i "$Path" -vf zscale=1280:720:filter=spline36 -c:v libsvtav1 -preset 5 -crf 28 -svtav1-params "enable-qm=1:fast-decode=1" -c:a libopus -b:a 192k -f matroska "$WebFile"; - - ffmpeg -hide_banner -y -ss 00:10:00 -i "$WebFile" -vframes 1 "$PictureFile" + .\ffmpeg.exe -hide_banner -y -i "$Path" -vf zscale=1280:720:filter=spline36 -c:v libsvtav1 -preset 5 -crf 28 -svtav1-params "enable-qm=1:fast-decode=1" -c:a libopus -b:a 192k -f matroska "$WebFile"; Write-Host "" Write-Host "Done" } + +cd .. diff --git a/Programs/template.vpy b/template.vpy similarity index 100% rename from Programs/template.vpy rename to template.vpy