Class: Ffprober::Wrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/ffprober/wrapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Wrapper

Returns a new instance of Wrapper.



5
6
7
# File 'lib/ffprober/wrapper.rb', line 5

def initialize(json)
  @json = json
end

Instance Attribute Details

#jsonObject (readonly)

Returns the value of attribute json.



3
4
5
# File 'lib/ffprober/wrapper.rb', line 3

def json
  @json
end

Instance Method Details

#audio_streamsObject



17
18
19
# File 'lib/ffprober/wrapper.rb', line 17

def audio_streams
  @audio_streams ||= stream_by_codec("audio").map { |data| Ffprober::AudioStream.new(data) }
end

#chaptersObject



25
26
27
# File 'lib/ffprober/wrapper.rb', line 25

def chapters
  @chapters ||= json[:chapters].map { |chapter| Ffprober::Chapter.new(chapter) }
end

#data_streamsObject



21
22
23
# File 'lib/ffprober/wrapper.rb', line 21

def data_streams
  @data_streams ||= stream_by_codec("data").map { |data| Ffprober::DataStream.new(data) }
end

#formatObject



9
10
11
# File 'lib/ffprober/wrapper.rb', line 9

def format
  @format ||= Ffprober::Format.new(json[:format])
end

#subtitle_streamsObject



29
30
31
# File 'lib/ffprober/wrapper.rb', line 29

def subtitle_streams
  @subtitle_streams ||= stream_by_codec("subtitle").map { |stream| Ffprober::SubtitleStream.new(stream) }
end

#video_streamsObject



13
14
15
# File 'lib/ffprober/wrapper.rb', line 13

def video_streams
  @video_streams ||= stream_by_codec("video").map { |data| Ffprober::VideoStream.new(data) }
end