Batch convert flv to mp3 in Windows with ruby
29.Nov 2008 - 08:58 | Tags: nerdstuff, code-snipplets, ruby, batch, mplayer, flv, mp3I’m sure you could also do the scripting part with a batch file, but this was easier for me:
1. Get MPlayer for Win32 from over here
2. Do some ruby magic:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
require "Fileutils"
input_files = Dir["*.flv"]
input_files.each{|filename|
prefix = filename.split(".")[0]
commandline="MPlayer-p4-svn-27811\\mplayer.exe -dumpfile \"#{prefix}.mp3\" -dumpaudio \"#{prefix}.flv\""
puts "Executing: " + commandline
IO.popen (commandline) { |f| puts f.gets }
}
|
3. Profit!