Sha256: 743aeb153a4fc9e7f72bcea70671ada5037d8435f117476f994aaeeb146edca7

Contents?: true

Size: 594 Bytes

Versions: 4

Compression:

Stored size: 594 Bytes

Contents

# An abstract class for asyncronous jobs that transcode files using FFMpeg
module Hydra::Derivatives::Processors
  module Ffmpeg
    extend ActiveSupport::Concern

    INPUT_OPTIONS = :input_options
    OUTPUT_OPTIONS = :output_options

    included do
      include ShellBasedProcessor
    end

    module ClassMethods
      def encode(path, options, output_file)
        inopts = options[INPUT_OPTIONS] ||= "-y"
        outopts = options[OUTPUT_OPTIONS] ||= ""
        execute "#{Hydra::Derivatives.ffmpeg_path} #{inopts} -i \"#{path}\" #{outopts} #{output_file}"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hydra-derivatives-3.2.2 lib/hydra/derivatives/processors/ffmpeg.rb
hydra-derivatives-3.2.1 lib/hydra/derivatives/processors/ffmpeg.rb
hydra-derivatives-3.2.0 lib/hydra/derivatives/processors/ffmpeg.rb
hydra-derivatives-3.1.4 lib/hydra/derivatives/processors/ffmpeg.rb