Skip to content

Instantly share code, notes, and snippets.

@meleyal
Created December 7, 2011 09:20
Show Gist options
  • Save meleyal/1442130 to your computer and use it in GitHub Desktop.
Save meleyal/1442130 to your computer and use it in GitHub Desktop.
Convert MP3s to OGG with ffmpeg
# INSTRUCTIONS
# - Put this file into a directory containing mp3s
# - Open in TextMate + run it (cmd+r)
dir = File.dirname(__FILE__)
mp3s = File.join(dir, "**", "*.mp3")
Dir.glob(mp3s) do |f|
p "Encoding file #{f}"
p "creating ogg..."
p `ffmpeg -i "#{f}" -acodec libvorbis "#{f.gsub('.mp3', '.ogg')}"`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment