Class: FFmpegCore::Screenshot

Inherits:
Object
  • Object
show all
Defined in:
lib/ffmpeg_core/screenshot.rb

Overview

Extract screenshots from video files

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input_path, output_path, options = {}) ⇒ Screenshot

Returns a new instance of Screenshot.



10
11
12
13
14
# File 'lib/ffmpeg_core/screenshot.rb', line 10

def initialize(input_path, output_path, options = {})
  @input_path = input_path.to_s
  @output_path = output_path.to_s
  @options = options
end

Instance Attribute Details

#input_pathObject (readonly)

Returns the value of attribute input_path.



8
9
10
# File 'lib/ffmpeg_core/screenshot.rb', line 8

def input_path
  @input_path
end

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/ffmpeg_core/screenshot.rb', line 8

def options
  @options
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



8
9
10
# File 'lib/ffmpeg_core/screenshot.rb', line 8

def output_path
  @output_path
end

Instance Method Details

#extractObject



16
17
18
19
20
21
22
# File 'lib/ffmpeg_core/screenshot.rb', line 16

def extract
  validate_input!
  ensure_output_directory!

  command = build_command
  execute_command(command)
end