Module: Jack::Tasks::Ffmpeg
- Included in:
- Jack::Tasks
- Defined in:
- lib/jack/tasks/ffmpeg.rb
Instance Method Summary collapse
- #convert_to_flv(filename, size, output = nil, options = {}) ⇒ Object
- #ffmpeg(input, options = {}) ⇒ Object
- #grab_screenshot_from(filename, size, output = nil, options = {}) ⇒ Object
Instance Method Details
#convert_to_flv(filename, size, output = nil, options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/jack/tasks/ffmpeg.rb', line 14 def convert_to_flv(filename, size, output = nil, = {}) if output.is_a?(Hash) = output output = nil end default = {:rate => 25, :acodec => :mp3, :frequency => 22050, :overwrite => true, :size => size, :file => (output || filename + ".flv")} ffmpeg filename, default.update() [:file] end |
#ffmpeg(input, options = {}) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/jack/tasks/ffmpeg.rb', line 6 def ffmpeg(input, = {}) cmd = ['ffmpeg'] input = { :file => input } unless input.is_a?(Hash) :input, cmd, input :output, cmd, execute_command cmd.join(" ") end |
#grab_screenshot_from(filename, size, output = nil, options = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/jack/tasks/ffmpeg.rb', line 24 def grab_screenshot_from(filename, size, output = nil, = {}) if output.is_a?(Hash) = output output = nil end default = {:vframes => 1, :format => :image2, :disable_audio => true, :size => size, :file => (output || filename + ".jpg")} ffmpeg filename, default.update() [:file] end |