Class: Mediakit::FFprobe
- Inherits:
-
Object
- Object
- Mediakit::FFprobe
- Defined in:
- lib/mediakit/ffprobe.rb
Defined Under Namespace
Classes: FFprobeError
Instance Attribute Summary collapse
-
#driver ⇒ Object
readonly
Returns the value of attribute driver.
Instance Method Summary collapse
- #default_show_options ⇒ Object
- #execute(args = '') ⇒ Object
- #get_json(path) ⇒ Object
-
#initialize(driver) ⇒ FFprobe
constructor
A new instance of FFprobe.
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
#driver ⇒ Object (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_options ⇒ Object
21 22 23 24 25 26 |
# File 'lib/mediakit/ffprobe.rb', line 21 def [ '-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 |