#!/usr/bin/env ruby # remove key frame information from AVI (codec: Cinepak) # example result http://www.vimeo.com/3334387 # a name of AVI file filename = ARGV.shift f = open(filename) data = f.read f.close main, index = data.split('idx1') frames = main.split('00dc') header = frames.shift indexes = index.split('00dc') indexes.shift frames.each_with_index do |frame, i| if indexes[i][0] == 18 frames[i] = "\x00" * frame.size end end print [([header] + frames).join('00dc'), index].join('idx1')