I figured out how to write the decoder specific info.
I get the following data from SDP.
m=audio 49230 RTP/AVP 96
a=rtpmap:96 mpeg4-generic/16000/1
a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr;
config=1408; sizeLength=13; indexLength=3;
indexDeltaLength=3; profile=1; bitrate=64000
so i call the following function after MP4AddAudioTrack
MP4SetAudioProfileLevel( m_mp4File, 0x0F );
bool bRet=MP4SetTrackESConfiguration(m_mp4File,m_audioTrackId,rr,2);
where rr is a pointer array which contain 1408 which tells the type of AAC and the channel. This i was able to figure out from the following wiki.
http://wiki.multimedia.cx/index.php?title=MP4A#Audio_Specific_Config
when i use mp4info this is what get printed.
mp4info version trunk-r496
20121023-062928.639858.3.mp4:
Track Type Info
1 audio MPEG-4 AAC main, 13.696 secs, 64 kbps, 16000 Hz
2 video H264 Baseline@4.1, 13.578 secs, 54 kbps, 640x480 @ 7.070261 fps
This tells me the file contains necessary information for the deocder to start decoding.
However, when i use VLC to decode the VLC log shows this
[aac @ 0x7f9b70c17340] Number of bands (20) exceeds limit (3).
[0x7f9b70c02c48] avcodec decoder warning: cannot decode one frame (513 bytes)
Now, if you look at the bytes it says 513. this is what i write into the file. I get the AAC audio in RTP format which is of size 509 bytes. i Append 4 bytes in front of the AAC frame which contains the total bytes(509) and push it thru WriteSample.
I think I have to strip some data from AAC. When i use VLC to write a mp4 file, the size of the audio frame is less than 509.if i check using mp4info it says AAC Low complexity.
Am i doing something wrong. How should i write an AAC audio streamed in RTP format.
Thanks,
Aswin Paranji