bin/datamosh in aviglitch-0.0.3 vs bin/datamosh in aviglitch-0.1.0
- old
+ new
@@ -8,11 +8,11 @@
output = './out.avi'
all = false
opts = OptionParser.new do |opts|
opts.banner = "datamosh - AviGlitch's datamoshing video generator."
- opts.define_head "Usage: #{File.basename($0)} <input> [options]"
+ opts.define_head "Usage: #{File.basename($0)} [options] file [file2 ...]"
opts.separator "Options:"
opts.on("-o", "--output [OUTPUT]",
"Output the video to OUTPUT (./out.avi by default)") do |f|
output = f
end
@@ -32,15 +32,15 @@
exit 1
end
a = AviGlitch.open input.shift
a.glitch_with_index :keyframe do |frame, i|
- (!all && i == 0) ? frame : "\000" * frame.size # keep the first frame
+ (!all && i == 0) ? frame : nil # keep the first frame
end
input.each do |file|
b = AviGlitch.open file
b.glitch :keyframe do |frame|
- "\000" * frame.size
+ nil
end
a.frames.concat b.frames
end
a.output output