From d20189537f8ab07615a803ddca24403477c35dd6 Mon Sep 17 00:00:00 2001 From: Claude Toupin Date: Sun, 24 May 2026 08:21:19 -0400 Subject: [PATCH] Add support for 1916x1080 resolution with padding and adjust crop filter logic --- Crop-ClipsKling.ps1 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Crop-ClipsKling.ps1 b/Crop-ClipsKling.ps1 index ae38a88..24147f6 100644 --- a/Crop-ClipsKling.ps1 +++ b/Crop-ClipsKling.ps1 @@ -109,7 +109,10 @@ foreach ($video in $videos) { $inQuality = Format-Quality -BitRate $inInfo.BitRate $inAudioText = if ($inInfo.HasAudio) { 'yes' } else { 'no' } - if ($inInfo.Height -ne 1072 -or ($inInfo.Width -ne 1920 -and $inInfo.Width -ne 1928)) { + $is1072 = ($inInfo.Height -eq 1072 -and ($inInfo.Width -eq 1920 -or $inInfo.Width -eq 1928)) + $is1916x1080 = ($inInfo.Width -eq 1916 -and $inInfo.Height -eq 1080) + + if (-not $is1072 -and -not $is1916x1080) { Write-Host "Skipping: $($inInfo.FileName) (resolution $inRes)" continue } @@ -126,10 +129,17 @@ foreach ($video in $videos) { $outCropPath = Join-Path $targetFull ($video.BaseName + '.crop.mp4') $outFinalPath = Join-Path $targetFull $video.Name + if ($is1916x1080) { + $vfFilter = 'pad=1920:1082:2:1:black,crop=1920:1080:0:1' + } + else { + $vfFilter = 'scale=-2:1080,crop=1920:1080:(in_w-1920)/2:(in_h-1080)/2' + } + $ffArgs = @( '-y', '-i', $inputPath, - '-vf', 'scale=-2:1080,crop=1920:1080:(in_w-1920)/2:(in_h-1080)/2' + '-vf', $vfFilter ) if ($inInfo.HasAudio) {