Sha256: 938c7fcefd76ff903444927944c135ee70e107a66262a3f7c96288ab57117201

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

require 'tempfile'
require 'pathname'
require 'stringio'
require 'aviglitch/avi'
require 'aviglitch/base'
require 'aviglitch/frame'
require 'aviglitch/frames'

# 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'
#
module AviGlitch

  VERSION = '0.2.0'

  BUFFER_SIZE = 2 ** 24

  class << self
    ##
    # Returns AviGlitch::Base instance.
    # It requires +path_or_frames+ as String or Pathname, or Frames instance.
    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
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aviglitch-0.2.0 lib/aviglitch.rb