Class: EDL::Cutter

Inherits:
Object
  • Object
show all
Defined in:
lib/edl/cutter.rb

Overview

Can chop an offline edit into events according to the EDL

Direct Known Subclasses

FFMpegCutter

Instance Method Summary collapse

Constructor Details

#initialize(source_path) ⇒ Cutter

:nodoc:



4
5
6
# File 'lib/edl/cutter.rb', line 4

def initialize(source_path)
  @source_path = source_path
end

Instance Method Details

#cut(edl) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/edl/cutter.rb', line 8

def cut(edl)
  source_for_cutting = edl.from_zero #.without_transitions.without_generators
  # We need to use the original length in record
  source_for_cutting.events.each do | evt |
    cut_segment(evt, evt.rec_start_tc, evt.rec_start_tc + evt.length)
  end
end

#cut_segment(evt, start_at, end_at) ⇒ Object



16
17
18
# File 'lib/edl/cutter.rb', line 16

def cut_segment(evt, start_at, end_at)
  STDERR.puts "Cutting #{@source_path} from #{start_at} to #{end_at} - #{evt.num}"
end