Skip to content

Instantly share code, notes, and snippets.

@ucnv
Created August 8, 2009 04:09
Show Gist options
  • Save ucnv/164292 to your computer and use it in GitHub Desktop.
Save ucnv/164292 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'aviglitch'
base, keys = ARGV
keyframes = AviGlitch.new(keys).frames.map do |frame|
if frame.is_keyframe?
frame.data
else
nil
end
end.compact
avi = AviGlitch.new(base)
avi.glitch_with_index(:keyframe) do |data, idx|
keyframes[idx % keyframes.size]
end
avi.write 'out.avi'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment