Created
January 20, 2024 20:50
-
-
Save narenaryan/6991c4dcf6bd7d2ceeed8c7f6db7742d to your computer and use it in GitHub Desktop.
Convert all .mkv files to .mp4 with best quality, less size using FFMpeg
This file contains hidden or 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 each .mkv file in the current directory | |
for file in *.mkv; do | |
# Extract the filename without extension | |
filename=$(basename "$file" .mkv) | |
# Convert the .mkv file to .mp4 using FFMpeg | |
ffmpeg -i "$file" -vcodec libx264 -crf 27 -preset veryfast -c:a copy -s 960x540 "${filename}.mp4" & | |
done | |
# Wait for all the conversion processes to finish | |
wait | |
echo "Conversion complete!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment