Skip to content

Instantly share code, notes, and snippets.

@youpy
Created February 23, 2009 13:33
Show Gist options
  • Save youpy/68945 to your computer and use it in GitHub Desktop.
Save youpy/68945 to your computer and use it in GitHub Desktop.
#!/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')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment