Avalpa Community

The place where we can talk freely about Avalpa product and services
It is currently Sat May 28, 2022 12:09 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Missing aac_descriptor
PostPosted: Thu Nov 14, 2013 3:17 pm 
Offline

Joined: Thu Nov 14, 2013 3:06 pm
Posts: 1
There's an ac3_descriptor, but no aac_descriptor. It's part of the dvb spec so a little surprised it's not there.
Accidentally missed? Or just nobody has need it yet?
Thanks


Top
 Profile  
 
PostPosted: Fri Nov 15, 2013 11:52 am 
Offline

Joined: Sun Sep 22, 2013 10:29 am
Posts: 39
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group