Links

   Quran Explorer - Interactive Audio Recitations & Translations

Wednesday, March 16, 2011

Batch Convert Multimedia Files Using FFMPEG

I will show u how to batch convert multimedia files using a bash script.

The following script will get all .mp4 files from the current directory, convert them to .wav and save them in a folder called wav(still in the current directory). Of course u can modify this file to suit your specific conversion needs.

Save the following script as mp4_to_wav.sh and make it executable (chmod +x mp4_to_wav.sh):

#===================================
#the directory wav must be present in the current directory
for f in *.mp4;
do
ffmpeg -i "$f" "wav/${f%.mp4}.wav";
done
#====================================

Now i can accept ur coffee