Class: HLS::Input

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#jsonObject (readonly)

Returns the value of attribute json.



158
159
160
# File 'lib/hls.rb', line 158

def json
  @json
end

#pathObject (readonly)

Returns the value of attribute path.



158
159
160
# File 'lib/hls.rb', line 158

def path
  @path
end

Instance Method Details

#codecObject



170
# File 'lib/hls.rb', line 170

def codec      = stream.dig(:codec_name)

#durationObject



171
# File 'lib/hls.rb', line 171

def duration   = json.dig(:format, :duration)&.to_f

#framerateObject



172
# File 'lib/hls.rb', line 172

def framerate  = parse_rate(stream.dig(:r_frame_rate))

#heightObject



169
# File 'lib/hls.rb', line 169

def height     = stream.dig(:height)

#widthObject



168
# File 'lib/hls.rb', line 168

def width      = stream.dig(:width)