Created
January 9, 2023 20:20
-
-
Save arvidkahl/f1779d711b1158e5b8d58c8c82613db6 to your computer and use it in GitHub Desktop.
Convert non-square videos into squares
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
#!/bin/bash | |
# Loop through all MP4 files in the current directory | |
for file in *.mp4 | |
do | |
# Extract the file name without the .mp4 extension | |
filename=$(basename "$file" .mp4) | |
# Run the ffmpeg command for the current file | |
ffmpeg -i "$file" -filter_complex "scale=960:960:force_original_aspect_ratio=increase,crop=960:960" "${filename}_square.mp4" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment