Class: FFmpegCore::Compositor
- Inherits:
-
Object
- Object
- FFmpegCore::Compositor
- Defined in:
- lib/ffmpeg_core/compositor.rb
Overview
Execute FFmpeg operations with multiple input files
Instance Attribute Summary collapse
-
#input_paths ⇒ Object
readonly
Returns the value of attribute input_paths.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
Instance Method Summary collapse
-
#initialize(input_paths, output_path, options = {}) ⇒ Compositor
constructor
A new instance of Compositor.
-
#run {|Float| ... } ⇒ String
Run the FFmpeg compositing command.
Constructor Details
#initialize(input_paths, output_path, options = {}) ⇒ Compositor
Returns a new instance of Compositor.
40 41 42 43 44 45 46 |
# File 'lib/ffmpeg_core/compositor.rb', line 40 def initialize(input_paths, output_path, = {}) raise ArgumentError, "At least one input path is required" if Array(input_paths).empty? @input_paths = Array(input_paths).map(&:to_s) @output_path = output_path.to_s @options = end |
Instance Attribute Details
#input_paths ⇒ Object (readonly)
Returns the value of attribute input_paths.
24 25 26 |
# File 'lib/ffmpeg_core/compositor.rb', line 24 def input_paths @input_paths end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
24 25 26 |
# File 'lib/ffmpeg_core/compositor.rb', line 24 def @options end |
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
24 25 26 |
# File 'lib/ffmpeg_core/compositor.rb', line 24 def output_path @output_path end |
Instance Method Details
#run {|Float| ... } ⇒ String
Run the FFmpeg compositing command
54 55 56 57 58 59 60 |
# File 'lib/ffmpeg_core/compositor.rb', line 54 def run(&block) validate_inputs! ensure_output_directory! command = build_command execute_command(command, &block) end |