Class: Hyrax::ActiveEncode::DefaultOptionService
- Inherits:
-
Object
- Object
- Hyrax::ActiveEncode::DefaultOptionService
- Defined in:
- app/services/hyrax/active_encode/default_option_service.rb
Class Method Summary collapse
-
.call(file_set) ⇒ Object
Returns default audio/video output options for ActiveEncode.
Class Method Details
.call(file_set) ⇒ Object
Returns default audio/video output options for ActiveEncode.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/services/hyrax/active_encode/default_option_service.rb', line 10 def self.call(file_set) # Defaults adapted from hydra-derivatives audio_encoder = Hydra::Derivatives::AudioEncoder.new if file_set.audio? [{ outputs: [{ label: 'mp3', extension: 'mp3' }, { label: 'ogg', extension: 'ogg' }] }] elsif file_set.video? [{ outputs: [{ label: 'mp4', extension: 'mp4', ffmpeg_opt: "-s 320x240 -g 30 -b:v 345k -ac 2 -ab 96k -ar 44100 -vcodec libx264 -acodec #{audio_encoder.audio_encoder}" }, { label: 'webm', extension: 'webm', ffmpeg_opt: "-s 320x240 -g 30 -b:v 345k -ac 2 -ab 96k -ar 44100 -vcodec libvpx -acodec libvorbis" }] }] else [] end end |