Class: EncodingDotCom::MediaInfo
- Inherits:
-
Object
- Object
- EncodingDotCom::MediaInfo
- 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
-
#audio_channels ⇒ Object
readonly
Returns the value of attribute audio_channels.
-
#audio_codec ⇒ Object
readonly
Returns the value of attribute audio_codec.
-
#audio_sample_rate ⇒ Object
readonly
Returns the value of attribute audio_sample_rate.
-
#bitrate ⇒ Object
readonly
Returns the value of attribute bitrate.
-
#display_aspect_ratio ⇒ Object
readonly
Returns the value of attribute display_aspect_ratio.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#frame_rate ⇒ Object
readonly
Returns the value of attribute frame_rate.
-
#pixel_aspect_ratio ⇒ Object
readonly
Returns the value of attribute pixel_aspect_ratio.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#video_bitrate ⇒ Object
readonly
Returns the value of attribute video_bitrate.
-
#video_codec ⇒ Object
readonly
Returns the value of attribute video_codec.
Instance Method Summary collapse
-
#initialize(node) ⇒ MediaInfo
constructor
Creates a MediaInfo object, given a <response> Nokogiri::XML::Node.
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_channels ⇒ Object (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_codec ⇒ Object (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_rate ⇒ Object (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 |
#bitrate ⇒ Object (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_ratio ⇒ Object (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 |
#duration ⇒ Object (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_rate ⇒ Object (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_ratio ⇒ Object (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 |
#size ⇒ Object (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_bitrate ⇒ Object (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_codec ⇒ Object (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 |