Class: PopCap::FFmpeg
- Inherits:
-
Object
- Object
- PopCap::FFmpeg
- Defined in:
- lib/pop_cap/ffmpeg/ffmpeg.rb
Overview
Public: This is a wrapper for the FFmpeg C library.
Examples
file = 'spec/fixtures/sample.flac'
ffmpeg = FFmpeg.new(filepath)
Instance Attribute Summary collapse
-
#commander ⇒ Object
Returns the value of attribute commander.
-
#filepath ⇒ Object
Returns the value of attribute filepath.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#error_message(message) ⇒ Object
Public: error_message.
-
#execute ⇒ Object
Public: execute a command.
-
#initialize(filepath, options = {}) ⇒ FFmpeg
constructor
Public: initialize.
Constructor Details
#initialize(filepath, options = {}) ⇒ FFmpeg
Public: initialize
filepath - Requires a valid filepath to a file on the local filesystem. commander - Defaults to Commander for executing system commands.
22 23 24 25 26 |
# File 'lib/pop_cap/ffmpeg/ffmpeg.rb', line 22 def initialize(filepath, ={}) check_for_ffmpeg_install @filepath, = filepath, @commander = [:commander] || Commander end |
Instance Attribute Details
#commander ⇒ Object
Returns the value of attribute commander.
15 16 17 |
# File 'lib/pop_cap/ffmpeg/ffmpeg.rb', line 15 def commander @commander end |
#filepath ⇒ Object
Returns the value of attribute filepath.
15 16 17 |
# File 'lib/pop_cap/ffmpeg/ffmpeg.rb', line 15 def filepath @filepath end |
#options ⇒ Object
Returns the value of attribute options.
15 16 17 |
# File 'lib/pop_cap/ffmpeg/ffmpeg.rb', line 15 def end |
Instance Method Details
#error_message(message) ⇒ Object
Public: error_message
message - Provide the message to return.
32 33 34 |
# File 'lib/pop_cap/ffmpeg/ffmpeg.rb', line 32 def () "Error #{message} #{filepath}." end |
#execute ⇒ Object
Public: execute a command
38 39 40 |
# File 'lib/pop_cap/ffmpeg/ffmpeg.rb', line 38 def execute @executed ||= commander.new(*command).execute end |