How do you convert an entire directory/folder with ffmpeg via command line or with a batch script?
I know this might be redundant but I use this script to batch convert files.
old_extension=$1
new_extension=$2
for i in *."$old_extension";
do ffmpeg -i "$i" "${i%.*}.$new_extension";
done
It takes 2 arguments to make it more flexible :
I create an alias for it but you can also use it manually like this:
sh batch_convert.sh mkv mp4
This would convert all the mkv
files into mp4
files.
As you can see it slightly more versatile. As long as ffmpeg
can convert it you can specify any two extensions.