Wednesday 29 October 2014

Script that will act as a converter in linux





Script that will convert mp3 to ogg ,  ogg to mp3 ,  mp4 to mp3 etc

### How to play music in Red-hat , Fedora,  Cent-Os ,  Debian,  Ubuntu with out installing player like vlc or any third party software .


Writer: Anuj Borah
Email : anujborah1@gmail.com


#!/bin/bash
clear
echo "This script will convert files )like mp3 to ogg or mp4 to ogg("
echo "Now Give me the folder location where the input files are present 9 )Ex- /home/anuj/Desktop("
read t
test -d $t
if [ $? -eq 0 ]
then
echo "$t is present."
cd $t
read -p "Give me input file format and output file format ...." q e

for file in *.$q;

   do ffmpeg -i "${file}" -acodec libvorbis "${file%q}.$e";

done
clear
echo "ALL Done .  Your outputs are `ls -l *.$e` "
else
clear
echo "No such $t folder. Try Again "
fi



No comments:

Post a Comment

Popular Posts