Class: SamveraHls::Derivatives::Processors::Audio

Inherits:
Hydra::Derivatives::Processors::Audio
  • Object
show all
Includes:
Media
Defined in:
lib/samvera_hls/derivatives/processors/audio.rb

Instance Method Summary collapse

Methods included from Media

#encode_file, #encode_hls

Instance Method Details

#codecs(format) ⇒ Object



20
21
22
23
24
# File 'lib/samvera_hls/derivatives/processors/audio.rb', line 20

def codecs(format)
  return super unless format.include?("hls")
  options = get_hls_options(format)
  "-acodec #{options[:acodec]}"
end

#options_for(format) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/samvera_hls/derivatives/processors/audio.rb', line 9

def options_for(format)
  return super unless format.include?("hls")
  input_options="-y"
  outopts = get_hls_options(format).symbolize_keys
  output_options = "-acodec #{outopts[:acodec]} -b:a #{outopts[:bitrate]} -maxrate: #{outopts[:maxrate]} -f segment -segment_time #{outopts[:segment_time]} -flags -global_header -segment_format mpeg_ts -segment_list_type m3u8"

  { Hydra::Derivatives::Processors::Ffmpeg::OUTPUT_OPTIONS => output_options, 
    Hydra::Derivatives::Processors::Ffmpeg::INPUT_OPTIONS => input_options,
    :format => format}
end