require 'rubygems' require 'streamio-ffmpeg' threads = [] i = 1 Dir.glob('*.avi') do |f| j = i.to_s threads.push Thread.new { begin movie = FFMPEG::Movie.new(File.absolute_path(f)); movie.transcode(j+'.mp4') { |progress| puts j + ": " + progress.to_s } rescue puts "shit!" end } i += 1 end threads.each {|t| t.join }