Just add these 2 scripts to a directory you want to be convert your avi files (./convdir
).
Run ./convdir/batchavi2mp4
and your done. Example:
- /convdir
- batchavi2mp3
- avi2mp3
- mp3file1
- mp3file2
- mp3file3
- mp3file4
- mp3filex
- avifile1
- avifile2
- avifile3
- avifile4
- avifilex
batchavi2mp3
for i in *.avi; do
avi2mp3 "${i}"
done
avi2mp3
fin="$1"
fout=$fin
fout=${fout%".avi"}
fname=$fout
fout="$fout.mp3"
echo;
echo Converting $fname ....
echo _Input: $fin
echo Output: $fout
echo;
#ffmpeg -i "$fin" -acodec libmp3lame -ac 2 -ab 128k -vn -y "$fout"
avconv -i "$fin" -vn -f mp3 "$fout"
echo;
echo -------------------
echo;
You can get fancy like I have and move the files out from here to like /videos /music and set a cron job script to run. I still working with avconv. Some devices are not liking avconv (ffmpg was working so long .... sigh)