Open lastrosade opened 2 years ago
A few examples of scaling:
input 3800x3000 in box of size 2560x1440 scaled to 1824x1440 input 1920x1080 in box of size 2560x1440 scaled to 1920x1080 input 1080x1920 in box of size 2560x1440 scaled to 810x1440 input 2000x2000 in box of size 2560x1440 scaled to 1440x1440 input 3840x2160 in box of size 2560x1440 scaled to 2560x1440 input 4096x2160 in box of size 2560x1440 scaled to 2560x1350 input 3072x1920 in box of size 2560x1440 scaled to 2304x1440
input 1920x1001 in box of size 2560x1440 scaled to 1920x1001 with a crop to 1920x1000
input 4096x2160 in box of size 1280x720 scaled to 1280x675 with a crop to 1280x674 input 1920x1080 in box of size 1280x720 scaled to 1280x720
input 4096x2160 in box of size 1920x1080 scaled to 1920x1012 input 3072x1920 in box of size 1920x1080 scaled to 1728x1080
So it will scale whenever the width/height is larger than the specified max width/height? And always crop mod2?
Yes, and both
So uhhh, as it turns out ffmpeg's scale can already do this.
scale=w=2560:h=1440:force_original_aspect_ratio=decrease:force_divisible_by=2
force_original_aspect_ratio
Enable decreasing or increasing output video width or height if necessary to keep the original aspect ratio. Possible values:
force_divisible_by
Ensures that both the output dimensions, width and height, are divisible by the given integer when used together with force_original_aspect_ratio. This works similar to using -n in the w and h options.
Add a way to set a maximum height and width for when batch processing.
This allows us to downscale videos to fit inside a set box while keeping aspect ratio.
This only downscales.
This is an example of how I do it in powershell.