Add support for 1916x1080 resolution with padding and adjust crop filter logic

This commit is contained in:
2026-05-24 08:21:19 -04:00
parent 33a49f39aa
commit d20189537f
+12 -2
View File
@@ -109,7 +109,10 @@ foreach ($video in $videos) {
$inQuality = Format-Quality -BitRate $inInfo.BitRate $inQuality = Format-Quality -BitRate $inInfo.BitRate
$inAudioText = if ($inInfo.HasAudio) { 'yes' } else { 'no' } $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)" Write-Host "Skipping: $($inInfo.FileName) (resolution $inRes)"
continue continue
} }
@@ -126,10 +129,17 @@ foreach ($video in $videos) {
$outCropPath = Join-Path $targetFull ($video.BaseName + '.crop.mp4') $outCropPath = Join-Path $targetFull ($video.BaseName + '.crop.mp4')
$outFinalPath = Join-Path $targetFull $video.Name $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 = @( $ffArgs = @(
'-y', '-y',
'-i', $inputPath, '-i', $inputPath,
'-vf', 'scale=-2:1080,crop=1920:1080:(in_w-1920)/2:(in_h-1080)/2' '-vf', $vfFilter
) )
if ($inInfo.HasAudio) { if ($inInfo.HasAudio) {