Posts Tagged ‘convert’

Suse 11.1 bash script to convert files mp4 to mp3

Monday, January 3rd, 2011

Find below script that converts MP4 files into MP3 :

Using mplayer and lameĀ :


#! /bin/bash
#
# Converts all MP4 files in the current directory to MP3s.
#
for f in *.mp4; do
newname=`echo $f | tr ' ' '_' `
mv "$f" $newname
f=$newname
mplayer $f -ao pcm:file=tmp.wav
lame -b 128 -q 2 tmp.wav ${f/.mp4/.mp3}
rm -f tmp.wav
done

Source page is here.