Skip to content

Instantly share code, notes, and snippets.

@bryant1410
Created November 28, 2014 02:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryant1410/418692ac8704ec87dc84 to your computer and use it in GitHub Desktop.
Save bryant1410/418692ac8704ec87dc84 to your computer and use it in GitHub Desktop.
Convert all mp4 files to mp3 in current directory, deleting them
#!/usr/bin/env bash
# seen in http://www.unixmen.com/linux-basics-convert-mp4-mp3/
for filename in *.mp4
do
name=`echo "$filename" | sed -e "s/.mp4$//g"`
ffmpeg -i "$filename" -b:a 192K -vn "$name.mp3"
rm "$filename"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment