Class: EncodingDotCom::MediaInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/encoding_dot_com/media_info.rb

Overview

Represents information about a video or image in the encoding.com queue

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ MediaInfo

Creates a MediaInfo object, given a <response> Nokogiri::XML::Node

See the encoding.com documentation for GetMediaInfo action for more details



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/encoding_dot_com/media_info.rb', line 11

def initialize(node)
  @bitrate = (node / "bitrate").text
  @duration = (node / "duration").text.to_f
  @video_codec = (node / "video_codec").text
  @video_bitrate = (node / "video_bitrate").text
  @frame_rate = (node / "frame_rate").text.to_f
  @size = (node / "size").text
  @pixel_aspect_ratio = (node / "pixel_aspect_ratio").text
  @display_aspect_ratio = (node / "display_aspect_ratio").text
  @audio_codec = (node / "audio_codec").text
  @audio_sample_rate = (node / "audio_sample_rate").text.to_i
  @audio_channels = (node / "audio_channels").text.to_i
end

Instance Attribute Details

#audio_channelsObject (readonly)

Returns the value of attribute audio_channels.



6
7
8
# File 'lib/encoding_dot_com/media_info.rb', line 6

def audio_channels
  @audio_channels
end

#audio_codecObject (readonly)

Returns the value of attribute audio_codec.



6
7
8
# File 'lib/encoding_dot_com/media_info.rb', line 6

def audio_codec
  @audio_codec
end

#audio_sample_rateObject (readonly)

Returns the value of attribute audio_sample_rate.



6
7
8
# File 'lib/encoding_dot_com/media_info.rb', line 6

def audio_sample_rate
  @audio_sample_rate
end

#bitrateObject (readonly)

Returns the value of attribute bitrate.



6
7
8
# File 'lib/encoding_dot_com/media_info.rb', line 6

def bitrate
  @bitrate
end

#display_aspect_ratioObject (readonly)

Returns the value of attribute display_aspect_ratio.



6
7
8
# File 'lib/encoding_dot_com/media_info.rb', line 6

def display_aspect_ratio
  @display_aspect_ratio
end

#durationObject (readonly)

Returns the value of attribute duration.



6
7
8
# File 'lib/encoding_dot_com/media_info.rb', line 6

def duration
  @duration
end

#frame_rateObject (readonly)

Returns the value of attribute frame_rate.



6
7
8
# File 'lib/encoding_dot_com/media_info.rb', line 6

def frame_rate
  @frame_rate
end

#pixel_aspect_ratioObject (readonly)

Returns the value of attribute pixel_aspect_ratio.



6
7
8
# File 'lib/encoding_dot_com/media_info.rb', line 6

def pixel_aspect_ratio
  @pixel_aspect_ratio
end

#sizeObject (readonly)

Returns the value of attribute size.



6
7
8
# File 'lib/encoding_dot_com/media_info.rb', line 6

def size
  @size
end

#video_bitrateObject (readonly)

Returns the value of attribute video_bitrate.



6
7
8
# File 'lib/encoding_dot_com/media_info.rb', line 6

def video_bitrate
  @video_bitrate
end

#video_codecObject (readonly)

Returns the value of attribute video_codec.



6
7
8
# File 'lib/encoding_dot_com/media_info.rb', line 6

def video_codec
  @video_codec
end