Class: StripAudio::Stripper
- Inherits:
-
Object
- Object
- StripAudio::Stripper
- Defined in:
- lib/strip_audio/stripper.rb
Constant Summary collapse
- @@options =
{format: "mp3", bitrate: "160k"}
Instance Method Summary collapse
-
#initialize(options) ⇒ Stripper
constructor
A new instance of Stripper.
- #strip(video_file) ⇒ Object
Constructor Details
#initialize(options) ⇒ Stripper
Returns a new instance of Stripper.
9 10 11 12 13 |
# File 'lib/strip_audio/stripper.rb', line 9 def initialize @@options.merge() doctor end |
Instance Method Details
#strip(video_file) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/strip_audio/stripper.rb', line 15 def strip video_file begin audio_file_exists?( video_file ) rescue Exception => e puts e. exit end o = `ffmpeg -i #{video_file} -ab #{@@options[:bitrate]} -ac 2 -ar 44100 -vn #{audio_file(video_file)} 2>&1` begin command_output o rescue Exception => e puts e. end end |