bin/datamosh in aviglitch-0.1.3 vs bin/datamosh in aviglitch-0.1.4

- old
+ new

@@ -32,31 +32,39 @@ puts opts exit end end -input = Dir.glob opts.parse! +input = opts.parse! if input.empty? puts opts exit 1 +else + input.each do |file| + if !File.exist?(file) || File.directory?(file) + opts.banner = "#{file}: No such file.\n\n" + puts opts + exit 1 + end + end end a = AviGlitch.open input.shift unless fake a.glitch_with_index :keyframe do |frame, i| (!all && i == 0) ? frame : "" # keep the first frame end end -a.clear_keyframes!(!all && !fake ? 1..a.frames.size : nil) +a.mutate_keyframes_into_deltaframes!(!all && !fake ? 1..a.frames.size : nil) input.each do |file| b = AviGlitch.open file unless fake b.glitch :keyframe do |frame| "" end end - b.clear_keyframes! + b.mutate_keyframes_into_deltaframes! a.frames.concat b.frames end a.output output