Sha256: 89cfd2a79f7383d6b609e43f7d22ce3c400e7c7b55156800165a2b44969647cf
Contents?: true
Size: 725 Bytes
Versions: 6
Compression:
Stored size: 725 Bytes
Contents
# An abstract class for asyncronous jobs that transcode files using FFMpeg require 'tmpdir' require 'open3' module Hydra module Derivatives 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] if options inopts ||= "-y" outopts = options[OUTPUT_OPTIONS] if options outopts ||= options execute "#{Hydra::Derivatives.ffmpeg_path} #{inopts} -i \"#{path}\" #{outopts} #{output_file}" end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems