Class: Mediakit::FFprobe

Inherits:
Object
  • Object
show all
Defined in:
lib/mediakit/ffprobe.rb

Defined Under Namespace

Classes: FFprobeError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(driver) ⇒ FFprobe

Returns a new instance of FFprobe.



8
9
10
# File 'lib/mediakit/ffprobe.rb', line 8

def initialize(driver)
  @driver = driver
end

Instance Attribute Details

#driverObject (readonly)

Returns the value of attribute driver.



3
4
5
# File 'lib/mediakit/ffprobe.rb', line 3

def driver
  @driver
end

Instance Method Details

#default_show_optionsObject



21
22
23
24
25
26
# File 'lib/mediakit/ffprobe.rb', line 21

def default_show_options
  [
    '-show_streams',
    '-show_format'
  ].join(' ')
end

#execute(args = '') ⇒ Object



12
13
14
# File 'lib/mediakit/ffprobe.rb', line 12

def execute(args = '')
  driver.run(args)
end

#get_json(path) ⇒ Object



16
17
18
19
# File 'lib/mediakit/ffprobe.rb', line 16

def get_json(path)
  args = "#{default_show_options} -print_format json #{path}"
  execute(args)
end