Skip to content

Instantly share code, notes, and snippets.

@nilskoppelmann
Created January 13, 2015 19:44
Show Gist options
  • Save nilskoppelmann/25697acf9577a8798d64 to your computer and use it in GitHub Desktop.
Save nilskoppelmann/25697acf9577a8798d64 to your computer and use it in GitHub Desktop.
toMP3
#!/bin/bash
while getopts "" opt; do
case $opt in
\?)
printf >&2 \
"invalid option: -$OPTARG\n
usage: toMp3 [-t type]\n"
exit 1;;
:)
echo >&2 \
"$0: option -$OPTARG requires an argument" >&2
exit 1;;
esac
done
while [ $# -gt 0 ]
do
name=`echo "$1" | sed -e "s/.mp4$//g"`
ffmpeg -i "$1" -vn -ar 44100 -ac 2 -ab 192k -f mp3 "$name.mp3"
shift
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment