Created
August 27, 2023 15:09
-
-
Save raveensrk/dbdaa2e2681b53243aa78d74d4a7bd20 to your computer and use it in GitHub Desktop.
How to square fit image using Bash and FFMPEG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
name=$(strip_extension "$1") | |
output_file_name="${name}-square.jpg" | |
ffmpeg -i "$1" -vf "scale='min(1080,iw)':'min(1080,ih)',pad=1080:1080:(1080-iw)/2:(1080-ih)/2" "$output_file_name" | |
echo "$output_file_name" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment