Class: Abrizer::CLI
- Inherits:
-
Thor
- Object
- Thor
- Abrizer::CLI
- Defined in:
- lib/abrizer/cli.rb
Class Method Summary collapse
- .add_shared_option(name, option_name, options = {}) ⇒ Object
- .input_banner ⇒ Object
- .input_desc ⇒ Object
- .shared_options(*names) ⇒ Object
Instance Method Summary collapse
- #abr ⇒ Object
- #adaptations ⇒ Object
- #all ⇒ Object
- #canvas ⇒ Object
- #captions ⇒ Object
- #clean ⇒ Object
- #data ⇒ Object
- #ffprobe ⇒ Object
- #inform ⇒ Object
- #mp3 ⇒ Object
- #mp4 ⇒ Object
- #package(dash_or_hls) ⇒ Object
- #poster ⇒ Object
- #process ⇒ Object
- #sprites ⇒ Object
- #vp9 ⇒ Object
Class Method Details
.add_shared_option(name, option_name, options = {}) ⇒ Object
13 14 15 16 |
# File 'lib/abrizer/cli.rb', line 13 def add_shared_option(name, option_name, = {}) @shared_options = {} if @shared_options.nil? @shared_options[name] = [option_name, ] end |
.input_banner ⇒ Object
26 27 28 |
# File 'lib/abrizer/cli.rb', line 26 def 'INPUT_FILEPATH' end |
.input_desc ⇒ Object
30 31 32 |
# File 'lib/abrizer/cli.rb', line 30 def input_desc 'Full or relative path to a mezzanine video file.' end |
.shared_options(*names) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/abrizer/cli.rb', line 18 def (*names) names.each do |name| opt = @shared_options[name] raise "Tried to access shared option '#{option_name}' but it was not previously defined" if opt.nil? method_option *opt end end |
Instance Method Details
#abr ⇒ Object
123 124 125 126 127 128 129 |
# File 'lib/abrizer/cli.rb', line 123 def abr filepath = [:input] output_dir = [:output] Abrizer::Processor.process(filepath, output_dir) Abrizer::PackageDashBento.new(filepath, output_dir).package Abrizer::PackageHlsBento.new(filepath, output_dir).package end |
#adaptations ⇒ Object
65 66 67 68 69 70 |
# File 'lib/abrizer/cli.rb', line 65 def adaptations input = [:input] output = [:output] adaptations = Abrizer::AdaptationsFile.new(input, output).adaptations puts adaptations end |
#all ⇒ Object
49 50 51 52 53 |
# File 'lib/abrizer/cli.rb', line 49 def all filepath = [:input] output_dir = [:output] Abrizer::All.new(filepath, output_dir, [:url], [:vp9]).run end |
#canvas ⇒ Object
165 166 167 168 169 |
# File 'lib/abrizer/cli.rb', line 165 def canvas filepath = [:input] output_directory = [:output] Abrizer::Canvas.new(filepath, output_directory, [:url]).create end |
#captions ⇒ Object
84 85 86 87 88 |
# File 'lib/abrizer/cli.rb', line 84 def filepath = [:input] output_dir = [:output] Abrizer::Captions.new(filepath, output_dir).copy end |
#clean ⇒ Object
181 182 183 184 |
# File 'lib/abrizer/cli.rb', line 181 def clean output_dir = [:output] Abrizer::Cleaner.new(output_dir).clean end |
#data ⇒ Object
173 174 175 176 177 |
# File 'lib/abrizer/cli.rb', line 173 def data filepath = [:input] output_directory = [:output] Abrizer::Data.new(filepath, output_directory, [:url]).create end |
#ffprobe ⇒ Object
57 58 59 60 61 |
# File 'lib/abrizer/cli.rb', line 57 def ffprobe filepath = [:input] output_dir = [:output] Abrizer::FfprobeFile.new(filepath, output_dir).run end |
#inform ⇒ Object
74 75 76 77 78 79 |
# File 'lib/abrizer/cli.rb', line 74 def inform input = [:input] informer = FfprobeInformer.new(filepath: input) puts informer.json_result puts informer end |
#mp3 ⇒ Object
100 101 102 103 104 |
# File 'lib/abrizer/cli.rb', line 100 def mp3 filepath = [:input] output_dir = [:output] Abrizer::ProgressiveMp3.new(filepath, output_dir).create end |
#mp4 ⇒ Object
141 142 143 144 |
# File 'lib/abrizer/cli.rb', line 141 def mp4 output_dir = [:output] Abrizer::ProgressiveMp4.new(output_dir).create end |
#package(dash_or_hls) ⇒ Object
148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/abrizer/cli.rb', line 148 def package(dash_or_hls) output_dir = [:output] case dash_or_hls when "dash" Abrizer::PackageDashBento.new(output_dir).package when "hls" Abrizer::PackageHlsBento.new(output_dir).package when "all" Abrizer::PackageDashBento.new(output_dir).package Abrizer::PackageHlsBento.new(output_dir).package else puts "Not a valid packaging value. Try dash or hls." end end |
#poster ⇒ Object
116 117 118 119 |
# File 'lib/abrizer/cli.rb', line 116 def poster output_dir = [:output] Abrizer::TemporaryPoster.new(output_dir).copy end |
#process ⇒ Object
133 134 135 136 137 |
# File 'lib/abrizer/cli.rb', line 133 def process filepath = [:input] output_dir = [:output] Abrizer::Processor.process(filepath, output_dir) end |
#sprites ⇒ Object
108 109 110 111 112 |
# File 'lib/abrizer/cli.rb', line 108 def sprites filepath = [:input] output_dir = [:output] Abrizer::Sprites.new(filepath, output_dir).create end |
#vp9 ⇒ Object
92 93 94 95 96 |
# File 'lib/abrizer/cli.rb', line 92 def vp9 filepath = [:input] output_dir = [:output] Abrizer::ProgressiveVp9.new(filepath, output_dir).create end |