Class: Av::Commands::Avconv

Inherits:
Base
  • Object
show all
Defined in:
lib/av/commands/avconv.rb

Instance Attribute Summary

Attributes inherited from Base

#audio_filters, #command_name, #default_params, #destination, #input_params, #options, #output_format, #output_params, #source, #video_filters

Instance Method Summary collapse

Methods inherited from Base

#add_destination, #add_input_param, #add_output_param, #add_source, #filter_seek, #identify, #parse_param, #reset_default_filters, #reset_input_filters, #reset_output_filters, #run, #set_input_params, #set_output_params

Constructor Details

#initialize(options = {}) ⇒ Avconv

Returns a new instance of Avconv.



7
8
9
10
11
# File 'lib/av/commands/avconv.rb', line 7

def initialize(options = {})
  super(options)
  @command_name = 'avconv'
  @default_params['loglevel'] = 'quiet' unless options[:quiet] == false
end

Instance Method Details

#filter_concat(list) ⇒ Object



13
14
15
16
# File 'lib/av/commands/avconv.rb', line 13

def filter_concat list
  add_input_param i: "concat:#{list.join('\|')} -c copy"
  self
end

#filter_rotate(degrees) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/av/commands/avconv.rb', line 23

def filter_rotate degrees
  raise ::Av::InvalidFilterParameter unless degrees % 90 == 0
  case degrees
    when 90
      add_input_param vf: 'clock'
    when 180
      add_input_param vf: 'vflip,hflip'
    when 270
      add_input_param vf: 'cclock'
  end
end

#filter_volume(vol) ⇒ Object



18
19
20
21
# File 'lib/av/commands/avconv.rb', line 18

def filter_volume vol
  add_input_param af: "volume=volume=#{vol}"
  self
end