Created
January 13, 2015 19:44
-
-
Save nilskoppelmann/25697acf9577a8798d64 to your computer and use it in GitHub Desktop.
toMP3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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