class VideoScreenshoter::Video

Public Class Methods

new(params) click to toggle source
Calls superclass method VideoScreenshoter::Abstract::new
# File lib/video_screenshoter/video.rb, line 6
def initialize params
  super
end

Public Instance Methods

make_screenshots()
Alias for: run
make_thumbnails()
Alias for: run
run() click to toggle source
# File lib/video_screenshoter/video.rb, line 10
def run
  times.each { |time| ffmpeg_run(time) and imagemagick_run(output_fullpath(time)) }
end
Also aliased as: make_screenshots, make_thumbnails

Private Instance Methods

input_duration() click to toggle source
# File lib/video_screenshoter/video.rb, line 19
def input_duration
  if matches = `#{ffmpeg} -i #{input} 2>&1`.match(/Duration:\s*(\d{2}):(\d{2}):(\d{2}\.\d{2})/)
    matches[1].to_i * 3600 + matches[2].to_i * 60 + matches[3].to_f
  end
end