Glitch AVI files using the Ruby API
masterYou can manipulate AVI frame data programmatically using the AviGlitch class.
- Open an AVI file with
AviGlitch.open(path). - Use the
glitchmethod, passing a symbol to specify which frames to target (e.g.,:keyframe). - Provide a block that receives the raw
dataof the frame and returns the modified data. - Save the result using
output(path).
Note: The library only parses the container-level structure and does not parse codecs. It is primarily used for datamoshing.
require 'aviglitch'
avi = AviGlitch.open('/path/to/your.avi')
avi.glitch(:keyframe) do |data|
data.gsub(/\d/, '0')
end
avi.output('/path/to/broken.avi')