Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo -e "Enter path to files to convert: "
- read path
- cd $path
- echo -e "What is the file format we are converting from (mkv, mp4, etc...): "
- read fileFormat
- echo -e "What is the file format we are converting to (mp3, mp4, etc...): "
- read fileFormatToConvertTo
- if [ $fileFormat = $fileFormatToConvertTo ]; then
- echo "Can't convert. Formats are the same"
- exit
- else
- for file in *.$fileFormat
- do
- name=`echo "$file" | sed -e "s/.$fileFormat$//g"`
- ffmpeg -i "$file" -vn -ar 44100 -ac 2 -ab 192k -f $fileFormatToConvertTo "$name.$fileFormatToConvertTo"
- done
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement