Class: Ffprobe::MediaFile
- Inherits:
-
Object
- Object
- Ffprobe::MediaFile
- Defined in:
- lib/ffprobe.rb
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(file_name) ⇒ MediaFile
constructor
A new instance of MediaFile.
- #streams ⇒ Object
Constructor Details
#initialize(file_name) ⇒ MediaFile
Returns a new instance of MediaFile.
7 8 9 10 11 12 13 |
# File 'lib/ffprobe.rb', line 7 def initialize file_name = "-hide_banner -loglevel panic -print_format json -show_format -show_streams" cmd = "ffprobe #{options} #{file_name}" stdout = `#{cmd}` file_hash = JSON.parse(stdout) @file = MyHash.new file_hash end |
Instance Method Details
#format ⇒ Object
21 22 23 |
# File 'lib/ffprobe.rb', line 21 def format MyHash.new @file.format end |
#streams ⇒ Object
15 16 17 18 19 |
# File 'lib/ffprobe.rb', line 15 def streams @file.streams.map do |stream| MyHash.new stream end end |