Created
April 25, 2024 12:42
-
-
Save HEPOSHEIKKI/c9ca5d7dcf9e48e1697c4275790c43cb to your computer and use it in GitHub Desktop.
Reformat a bunch of mkv files to 4:3 without transcoding.
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 | |
# Directory containing the media files | |
media_dir="/path/to/media/files" | |
output_dir="/path/to/output/dir" | |
cd "$media_dir" || exit | |
for i in *.mkv | |
do | |
if test -f "$i" | |
then | |
cleaned_name=$(echo "$i" | sed -e 's/[^A-Za-z0-9]/./g' | sed 's/\.\{2,\}/./g') | |
ffmpeg -i "$i" -aspect 720:540 -c copy "$output_dir$cleaned_name" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment