class DragonflyVideo::Processors::Screenshot

Constants

FFMPEG_COMMAND

Public Instance Methods

call(content, options = {}) click to toggle source
# File lib/dragonfly_video/processors/screenshot.rb, line 10
def call(content, options = {})
  format = options.delete(:format) { :jpg }

  content.shell_update(ext: format) do |old_path, new_path|
    "#{FFMPEG_COMMAND} -y -i #{old_path} -vframes 1 #{new_path}"
  end

  content.ext = format
  content
end
update_url(attrs, options = {}) click to toggle source
# File lib/dragonfly_video/processors/screenshot.rb, line 21
def update_url(attrs, options = {})
  format = options.fetch(:format, :jpg)
  attrs.ext = format.to_s
end