Method: FLV::Video#dimensions

Defined in:
lib/flvedit/flv/video.rb

#dimensionsObject

Returns dimensions as => w, :height => h, for Sorensen H.263 and screen video codecs only (otherwise returns nil)



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/flvedit/flv/video.rb', line 48

def dimensions
  w, h = case codec
    when :h263
      H263_DIMENSIONS[read_bits(38...41)]
    when :screen
      [12...24, 24...32]
  end
  return nil unless w
  w, h = [w, h].map{ |r| read_bits(r) } if w.is_a?(Range)
  {:width => w, :height => h}
end