Sha256: f632996e8dcaa8db0312103cdc578d000af77810e64a2c8c9e80463b432d17a6

Contents?: true

Size: 609 Bytes

Versions: 10

Compression:

Stored size: 609 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 #{Shellwords.escape(path)} #{outopts} #{output_file}"
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hydra-derivatives-3.7.0 lib/hydra/derivatives/processors/ffmpeg.rb
hydra-derivatives-3.6.1 lib/hydra/derivatives/processors/ffmpeg.rb
hydra-derivatives-3.6.0 lib/hydra/derivatives/processors/ffmpeg.rb
hydra-derivatives-3.5.0 lib/hydra/derivatives/processors/ffmpeg.rb
hydra-derivatives-3.4.2 lib/hydra/derivatives/processors/ffmpeg.rb
hydra-derivatives-3.4.1 lib/hydra/derivatives/processors/ffmpeg.rb
hydra-derivatives-3.4.0 lib/hydra/derivatives/processors/ffmpeg.rb
hydra-derivatives-3.3.2 lib/hydra/derivatives/processors/ffmpeg.rb
hydra-derivatives-3.3.1 lib/hydra/derivatives/processors/ffmpeg.rb
hydra-derivatives-3.3.0 lib/hydra/derivatives/processors/ffmpeg.rb