Class: MP4::Binary::Avc1

Inherits:
BinData::Record
  • Object
show all
Defined in:
lib/mp4/binary/avc1.rb

Instance Method Summary collapse

Instance Method Details

#bitrateObject



70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/mp4/binary/avc1.rb', line 70

def bitrate
  return @bitrate if defined?(@bitrate)

  index_of_btrt = all_rest.index('btrt')

  return unless index_of_btrt

  atom_start_pos = index_of_btrt - 4
  atom_size = BinData::Uint32be.read(all_rest[atom_start_pos..atom_start_pos + 4]).to_i
  atom_bytes = all_rest[atom_start_pos..atom_start_pos + 4 + atom_size]

  @bitrate = BtrtAtom.read(atom_bytes)
end

#paspObject



84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/mp4/binary/avc1.rb', line 84

def pasp
  return @pasp if defined?(@pasp)

  index_of_pasp = all_rest.index('pasp')

  return unless index_of_pasp

  atom_start_pos = index_of_pasp - 4
  atom_size = BinData::Uint32be.read(all_rest[atom_start_pos..atom_start_pos + 4]).to_i
  atom_bytes = all_rest[atom_start_pos..atom_start_pos + 4 + atom_size]

  @pasp = PaspAtom.read(atom_bytes)
end