class VideoConverter::Mp4frag

Attributes

bin[RW]
command[RW]

Public Class Methods

run(outputs) click to toggle source
# File lib/video_converter/mp4frag.rb, line 11
def self.run(outputs)
  success = true
  threads = []
                    command = Command.new(self.command, prepare_params(outputs))
  if VideoConverter.paral
    threads << Thread.new { success &&= command.execute }
  else
    success &&= command.execute
  end
  threads.each { |t| t.join } if VideoConverter.paral
  success
            end

Private Class Methods

prepare_params(outputs) click to toggle source
# File lib/video_converter/mp4frag.rb, line 26
        def self.prepare_params(outputs)
                {
:work_dir =>  outputs.select { |output| output.type != 'playlist' }.first.work_dir,
                        :bin => bin,
                        :inputs => { '--src' => outputs.select { |output| output.type != 'playlist' }.map { |input| "#{File.basename(input.ffmpeg_output)}" } },
                        :manifest => outputs.detect { |output| output.type == 'playlist' }.ffmpeg_output,
                        :log => outputs.first.log
                }
        end