Class: HLS::Input
- Inherits:
-
Object
- Object
- HLS::Input
- Defined in:
- lib/hls.rb
Instance Attribute Summary collapse
-
#json ⇒ Object
readonly
Returns the value of attribute json.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #codec ⇒ Object
- #duration ⇒ Object
- #framerate ⇒ Object
- #height ⇒ Object
-
#initialize(path) ⇒ Input
constructor
A new instance of Input.
- #width ⇒ Object
Constructor Details
#initialize(path) ⇒ Input
Returns a new instance of Input.
160 161 162 |
# File 'lib/hls.rb', line 160 def initialize(path) @path = Pathname(path) end |
Instance Attribute Details
#json ⇒ Object (readonly)
Returns the value of attribute json.
158 159 160 |
# File 'lib/hls.rb', line 158 def json @json end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
158 159 160 |
# File 'lib/hls.rb', line 158 def path @path end |
Instance Method Details
#codec ⇒ Object
170 |
# File 'lib/hls.rb', line 170 def codec = stream.dig(:codec_name) |
#duration ⇒ Object
171 |
# File 'lib/hls.rb', line 171 def duration = json.dig(:format, :duration)&.to_f |
#framerate ⇒ Object
172 |
# File 'lib/hls.rb', line 172 def framerate = parse_rate(stream.dig(:r_frame_rate)) |
#height ⇒ Object
169 |
# File 'lib/hls.rb', line 169 def height = stream.dig(:height) |
#width ⇒ Object
168 |
# File 'lib/hls.rb', line 168 def width = stream.dig(:width) |