Last active
June 30, 2023 06:33
-
-
Save lewangdev/4949643f82573431478f2c5a2ae753d0 to your computer and use it in GitHub Desktop.
Convert mkv to mp4 in h264 and aac
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 | |
if [ -z "$1" ] | |
then | |
echo "Please provide the directory as an argument." | |
exit 1 | |
fi | |
for file in "$1"/*.mkv | |
do | |
echo "Processing $file" | |
filename=$(basename -- "$file") | |
filename="${filename%.*}" | |
ffmpeg -i "$file" -c:v libx264 -crf 23 -c:a aac "$1/$filename.mp4" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment