Class: EDL::FFMpegCutter

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

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Cutter

#cut, #initialize

Constructor Details

This class inherits a constructor from EDL::Cutter

Instance Method Details

#cut_segment(evt, start_at, end_at) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/edl/cutter.rb', line 22

def cut_segment(evt, start_at, end_at)
  source_dir, source_file = File.dirname(@source_path), File.basename(@source_path)
  dest_segment = File.join(source_dir, ('%s_%s' % [evt.num, source_file]))
# dest_segment.gsub!(/\.mov$/i, '.mp4')
  
  offset = end_at - start_at
  
  cmd = "/opt/local/bin/ffmpeg -i #{@source_path} -ss #{start_at} -vframes #{offset.total} -vcodec photojpeg -acodec copy #{dest_segment}"
 #puts cmd 
 `#{cmd}`
end