Skip to content

Instantly share code, notes, and snippets.

@thomastraum
Forked from miketucker/gist:2775466
Created May 24, 2012 14:09
Show Gist options
  • Select an option

  • Save thomastraum/2781770 to your computer and use it in GitHub Desktop.

Select an option

Save thomastraum/2781770 to your computer and use it in GitHub Desktop.

Revisions

  1. @miketucker miketucker created this gist May 23, 2012.
    20 changes: 20 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    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 }