bin/datamosh in aviglitch-0.1.6 vs bin/datamosh in aviglitch-0.2.0
- old
+ new
@@ -52,10 +52,15 @@
unless fake
a.glitch_with_index :keyframe do |frame, i|
(!all && i == 0) ? frame : "" # keep the first frame
end
end
-a.mutate_keyframes_into_deltaframes!(!all && !fake ? 1..a.frames.size : nil)
+if !all && !fake
+ first = a.frames.index(a.frames.first_of(:keyframe))
+ a.mutate_keyframes_into_deltaframes! (first + 1)..a.frames.size
+else
+ a.mutate_keyframes_into_deltaframes!
+end
input.each do |file|
b = AviGlitch.open file
unless fake
b.glitch :keyframe do |frame|