Advertisement
Guest User

ffmpegFileConverter

a guest
Mar 5th, 2018
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.58 KB | None | 0 0
  1. #!/bin/bash
  2. echo -e "Enter path to files to convert: "
  3. read path
  4. cd $path
  5. echo -e "What is the file format we are converting from (mkv, mp4, etc...): "
  6. read fileFormat
  7. echo -e "What is the file format we are converting to (mp3, mp4, etc...): "
  8. read fileFormatToConvertTo
  9. if [ $fileFormat = $fileFormatToConvertTo ]; then
  10.     echo "Can't convert. Formats are the same"
  11.     exit
  12. else
  13.     for file in *.$fileFormat
  14.     do
  15.         name=`echo "$file" | sed -e "s/.$fileFormat$//g"`
  16.         ffmpeg -i "$file" -vn -ar 44100 -ac 2 -ab 192k -f $fileFormatToConvertTo "$name.$fileFormatToConvertTo"
  17.     done
  18. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement