Class: VTranscoder
- Inherits:
-
Object
- Object
- VTranscoder
- Defined in:
- lib/vtranscoder.rb
Constant Summary collapse
- FFMPEG_OPTIONS =
{ :b => 800, :r => 25, :vcodec => 'flv', :acodec => 'libmp3lame', :ab => 128, :ar => 44100 }
Instance Attribute Summary collapse
-
#source ⇒ Object
Returns the value of attribute source.
Class Method Summary collapse
Instance Method Summary collapse
- #convert(destination) ⇒ Object
- #convert_with_options(destination, options) ⇒ Object
-
#initialize(source) ⇒ VTranscoder
constructor
A new instance of VTranscoder.
Constructor Details
#initialize(source) ⇒ VTranscoder
Returns a new instance of VTranscoder.
18 19 20 21 |
# File 'lib/vtranscoder.rb', line 18 def initialize(source) @source = source verify_source_exists end |
Instance Attribute Details
#source ⇒ Object
Returns the value of attribute source.
3 4 5 |
# File 'lib/vtranscoder.rb', line 3 def source @source end |
Class Method Details
.retrieve(url) ⇒ Object
14 15 16 |
# File 'lib/vtranscoder.rb', line 14 def self.retrieve(url) # download a file to a temporary location and return a VTranscoder object referencing it end |
Instance Method Details
#convert(destination) ⇒ Object
28 29 30 |
# File 'lib/vtranscoder.rb', line 28 def convert(destination) destination, FFMPEG_OPTIONS end |
#convert_with_options(destination, options) ⇒ Object
23 24 25 26 |
# File 'lib/vtranscoder.rb', line 23 def (destination,) verify_ffmpeg_exists run_ffmpeg , destination end |