Guest User

Untitled

a guest
Apr 22nd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.58 KB | None | 0 0
  1. #!/usr/bin/ruby
  2.  
  3. require 'rubygems'
  4. require 'aviglitch'
  5.  
  6.  
  7. a = AviGlitch.open 'in.avi'       # Rewrite this line for your file.
  8. d = []
  9. a.frames.each_with_index do |f, i|
  10.   d.push(i) if f.is_deltaframe?     # Collecting non-keyframes indices.
  11. end
  12. q = a.frames[0, 5]                  # Keep first key frame.
  13. 100.times do
  14.   x = a.frames[d[rand(d.size)], 1]  # Select a certain non-keyframe.
  15.   q.concat(x * rand(50))            # Repeat the frame n times and concatenate with q.
  16. end
  17. o = AviGlitch.open q                # New AviGlitch instance using the frames.
  18. o.output 'out.avi'
Add Comment
Please, Sign In to add comment