- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Have you found the example code in UMC manual?
\audio-video-codecs\doc\umc-manual.pdf
Example 5-1 AACDecoder Initialization
and Example 5-2 AACDecoder Usage.
provides the example code on AAC decoder usage.
Thanks,
Chao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know that Axis Camera uses AAC LC (MPEG-4 Audio). I need to know:
1) Size of input buffer for AACDecoder->GetFrame() [1024 bytes ??? ] - it always returns me Bad Stream error code.
2) Do I need to use MP4Splitter in order to read frames from the stream?
3) How to initialize MP4Splitter correctly if it is needed.
Actually I could not say that examples are clear enough because sometimes it's difficult to understand purpose of specified variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Is the input data raw AAC audio data, or the AAC data in the MP4 container? If it is in the MP4 container, it needs the MP4Splitter.
Maybe you can attach one audio data. That will be helpful to check the problem.
Thanks,
Chao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems that it is raw AAC audio data. I attached file that contains audio data that I receive from Axis camera (aac_buffer). Maybe it will be helpful for you in order to understand what kind of data I receive and how to deal with it.
But what I can see now is that there is some marker that probably shows where the next frame begins. I mean this set of bytes: 0x00 0x10 0x0F ... 0x01. I am really looking forward your answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[bash]unsigned char data[2]; data[0] = 0x15; /* 5bits: 00010 - LC; 4 bits: 1011 - sample rate index (11 --- 8000Hz) data[1] = 0x88; 4bits: 0001 - 1 channel (front-center); 1bit: 0 - 1024 frame size; 1bit: 0 - depends on core; 1bit: 0 - ext. flag */ UMC::MediaData codecData; codecData.SetBufferPointer(&data[0],2); codecData.SetDataSize(2); // where mIppParams is AACDecoderParams mIppParams.m_info_in.sample_frequency = 8000; mIppParams.m_info_in.bitrate = 32000; mIppParams.m_info_in.bitPerSample = 16; mIppParams.m_info_in.channels = 1; mIppParams.m_info_in.stream_type = UMC::AAC_MPEG4_STREAM; mIppParams.m_pData = &codecData; mIppParams.profile = AAC_PROFILE_LC; // returns UMC_OK UMC::Status status = mIppDecoder.Init(&mIppParams);[/bash]
Then I try to pass 1024 (2048, etc.) bytes of audio data (I attached file with audio data in the previous message) to the decoder and it returns OK or BAD_STREAM error code. In my case decoded data is noise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1) I obtaine raw AAC MPEG-4 samples.
2) RTP protocol is used for transmission.
3) Transmission mode: AAC-hbr.
4) RFC 3640 explaines detailes.
Each RTP packet in AAC-hbr mode contains:
1) Access unit headers length field - 2 bytes - size of AU-headers in bits (in my case 0x10 -> 16 -> 2 bytes)
2) Set of AU-headers - Each header has size 2 bytes for AAC-hbr mode.
3) Access unit (AU) - AAC frame(s)
In my case I have 1 AU header + 1 AU per one RTP packet. Thus, I had to remove first 4 bytes of RTP packet payload and pass the rest (AU) to the decoder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Glad to know it works now. Some more comments from our AAC experts on raw AAC data support:
UMC AAC decoder supports ADIF format files only 1 header in the beginning of the stream (to set sample rate, stream type) and then raw AAC data.
Thanks,
Chao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I think scandinaf were using the sample in the manual (audio-video-codecs\doc\umc-manual.pdf)
Example 5-1 AACDecoder Initialization
and Example 5-2 AACDecoder Usage.
but, please note UMC AAC decoder supports ADIF format files, and RTP package payload need to be removed before pass the data to AAC decoders.
Thanks,
Chao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[cpp] // initialization // http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio unsigned char data[2]; data[0] = 0x14; // 5bits: 00010 - LC; 4 bits: 1000 - sample rate index (8 --- 16000Hz) data[1] = 0x08; // 4bits: 0001 - 1 channel (front-center); 1bit: 0 - 1024 frame size; // 1bit: 0 - depends on core; 1bit: 0 - ext. flag */ UMC::MediaData codecData; codecData.SetBufferPointer(&data[0],2); codecData.SetDataSize(2); UMC::AACDecoderParams params; params.m_info_in.stream_type = UMC::AAC_MPEG4_STREAM; params.m_pData = &codecData; params.ModeDecodeHEAACprofile = HEAAC_LP_MODE; params.ModeDwnsmplHEAACprofile = HEAAC_DWNSMPL_OFF; params.flag_SBR_support_lev = SBR_DISABLE; // returns UMC_OK UMC::Status status = decoder.Init(¶ms); decoder.GetInfo(¶ms); Ipp32s needSize = params.m_SuggestedOutputSize; // decoding // live555 takes care about AU Header removing from data UMC::MediaData in; status = in.SetBufferPointer((Ipp8u *)data, i_size); status = in.SetDataSize(i_size); UMC::AudioData out; status = out.Alloc(needSize); status = decoder.GetFrame(&in,&out); [/cpp]
In my case I would love if you give me a clue in manual that for RTP I need to set UMC::AAC_MPEG4_STREAM... It is not obvious as described in your current documentation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for your update. I agree we could have some improvement on the document in this part. I willcreate an internal request on adding information on this RTP stream part.
Thanks,
Chao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm having trouble getting the decoder working for a raw aac stream, trying to use the code above.
My config code is 0x1190. 2 channels, 48000Hz,. When I get to the call to decoder.GetInfo this returns an error code 3 (decoder not ready). Which I'd probably expect since I have't yet decoded a frame, but does this mean this call in the above example was also returning this error?
Then the value in params.m_SuggestedOutputSize is 40960 which seems very big for one frame of aac (1024 pcm samples)?
Then when I make the call to decoder.GetFrame I get an error -882 (invalid stream), does anyone have any ideas why this results in an error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
Michael

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page