Skip to content

Commit 5c34c87

Browse files
authored
Reduce HD Height if HD Width > 3840 (#21)
YouTube has a maximum width of 3840 for its 4K encodes.
1 parent e2df95d commit 5c34c87

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

encode.avs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,15 @@ width = (ARCorrection \
169169
.ForceModulo(mod, true)
170170
hStretch= height / last.height
171171

172+
# YouTube has a 4K width limit of 3840
173+
if (hd && (width > 3840)) {
174+
width = 3840
175+
height = (ARCorrection \
176+
? width * hAspect / wAspect \
177+
: width * last.height / last.width) \
178+
.ForceModulo(mod, true)
179+
}
180+
172181
# Rescaling
173182
# hd: resize to 4K, then just subsample with lanczos in the end
174183
# handheld: do nothing

0 commit comments

Comments
 (0)