Class: SamveraHls::Derivatives::Processors::Video
- Inherits:
-
Hydra::Derivatives::Processors::Video::Processor
- Object
- Hydra::Derivatives::Processors::Video::Processor
- SamveraHls::Derivatives::Processors::Video
show all
- Includes:
- Media
- Defined in:
- lib/samvera_hls/derivatives/processors/video.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/video.rb', line 20
def codecs(format)
return super unless format.include?("hls")
options = get_hls_options(format)
"-vcodec #{options[:vcodec]} -acodec #{options[:acodec]}"
end
|
#options_for(format) ⇒ Object
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/samvera_hls/derivatives/processors/video.rb', line 9
def options_for(format)
return super unless format.include?("hls")
input_option_string="-y"
outopts = get_hls_options(format).symbolize_keys
output_option_string = "-pix_fmt #{outopts[:pix_fmt]} -vcodec #{outopts[:vcodec]} -acodec #{outopts[:acodec]} -r #{outopts[:r]} -profile:v #{outopts[:profile_v]} -level #{outopts[:level]} -b:v #{outopts[:bitrate]} -maxrate: #{outopts[:maxrate]} -f segment -segment_time #{outopts[:segment_time]} -g #{outopts[:g]} -map 0 -flags -global_header -segment_format mpeg_ts -segment_list_type m3u8 -vf #{outopts[:vf]} "
{ Hydra::Derivatives::Processors::Ffmpeg::OUTPUT_OPTIONS => output_option_string,
Hydra::Derivatives::Processors::Ffmpeg::INPUT_OPTIONS => input_option_string,
:format => format}
end
|