lib/hydra/derivatives/ffmpeg.rb in hydra-derivatives-0.0.7 vs lib/hydra/derivatives/ffmpeg.rb in hydra-derivatives-0.0.8
- old
+ new
@@ -6,18 +6,25 @@
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)
- execute "#{Hydra::Derivatives.ffmpeg_path} -y -i \"#{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