Hello,
thanx for the request. it seems indeed no one ever asked us to implement it.
anyway the implementation is very easy in python:
Code:
######################################################################
# See Annex H of EN300468
class AAC_descriptor(Descriptor):
descriptor_tag = 0x7C
def bytes(self):
for property, value in vars(self).iteritems():
if not property in ['additional_info', 'AAC_type','profile_and_level']:
print "WARN: unrecognized attribute ", property, " in object ", self
stream = pack( "!B", self.profile_and_level)
if hasattr (self, 'AAC_type') | hasattr (self, 'additional_info'):
if hasattr (self, 'AAC_type'):
stream += pack("BB", 0xFF, self.AAC_type)
else:
stream += pack("B", 0x7F)
if hasattr (self, 'additional_info'):
stream += pack("%ds" % len(self.additional_info), self.additional_info)
return stream
then you can use it in your PMT this way:
Code:
pmt4 = program_map_section(
program_number = avalpa_sid,
PCR_PID = video1_pid,
program_info_descriptor_loop = [],
stream_loop = [
...
stream_loop_item(
stream_type = 0x0f, # mpeg2 AAC audio stream type
elementary_PID = audio1_pid,
element_info_descriptor_loop = [
# ERROR: missing profile_and_level
#AAC_descriptor(
#),
# WARN: wrong attribute
AAC_descriptor(
profile_and_level = 0x01,
attribute_not_present = 0,
),
# OK ,simplest case
AAC_descriptor(
profile_and_level = 0x01,
),
# OK with AAC_type 0xFF 0x03
AAC_descriptor(
profile_and_level = 0x02,
AAC_type = 0x03, # HE-AAC audio, stereo, see Table 26 EN300468
),
# OK: missing AAC_type so 0x7f
AAC_descriptor(
profile_and_level = 0x03,
additional_info = "some info 1",
),
# OK, full case
AAC_descriptor(
profile_and_level = 0x04,
AAC_type = 0x05, # HE-AAC audio, surround sound, see Table 26 EN300468
additional_info = "some info 2",
),
],
),
...
],
)
we'll add in OpenCaster trunk at next release
bye