Module: AviGlitch

Defined in:
lib/aviglitch.rb,
lib/aviglitch/avi.rb,
lib/aviglitch/base.rb,
lib/aviglitch/frame.rb,
lib/aviglitch/frames.rb

Overview

AviGlitch provides the ways to glitch AVI formatted video files.

Synopsis:

You can manipulate each frame, like:

avi = AviGlitch.open '/path/to/your.avi'
avi.frames.each do |frame|
  if frame.is_keyframe?
    frame.data = frame.data.gsub(/\d/, '0')
  end
end
avi.output '/path/to/broken.avi'

Using the method glitch, it can be written like:

avi = AviGlitch.open '/path/to/your.avi'
avi.glitch(:keyframe) do |data|
  data.gsub(/\d/, '0')
end
avi.output '/path/to/broken.avi'

Defined Under Namespace

Classes: Avi, Base, Frame, Frames

Constant Summary collapse

VERSION =
'0.2.0'
BUFFER_SIZE =
2 ** 24

Class Method Summary collapse

Class Method Details

.open(path_or_frames) ⇒ Object

Returns AviGlitch::Base instance. It requires path_or_frames as String or Pathname, or Frames instance.



41
42
43
44
45
46
47
# File 'lib/aviglitch.rb', line 41

def open path_or_frames
  if path_or_frames.kind_of?(Frames)
    path_or_frames.to_avi
  else
    AviGlitch::Base.new(Pathname(path_or_frames))
  end
end