Skip to content

Instantly share code, notes, and snippets.

@mondalaci
Created April 30, 2013 00:55
Show Gist options
  • Save mondalaci/5485960 to your computer and use it in GitHub Desktop.
Save mondalaci/5485960 to your computer and use it in GitHub Desktop.
Convert mp4 to mp3.
#!/bin/bash
if [ $# -eq 0 -o "$1" = '-h' -o "$1" = '--help' ]; then
echo "Usage: $0 INPUT.MP4 [...]"
exit
fi
for input_mp4 in "$@"; do
output_mp3=${input_mp4/.mp4/.mp3}
ffmpeg -i "$input_mp4" -y -vn -ar 44100 -ac 2 -ab 192000 -f mp3 "$output_mp3"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment