[MPlayer-dev-eng] About ADTS header, add adts header to raw aac data

qwen dux qwendu at gmail.com
Tue Sep 25 10:02:57 CEST 2007


I received the raw acc data from network, but mplayer can't decode normally,
faad2 also can not work.So I attempt to add the adts header in front of each
raw aac data.There is the detail:
buffer[0] = 0xff;
buffer[1] = 0xf8;
buffer[2] = 0x00 | (0x03 << 2);
buffer[3] = 0x80 | ((au_arg.unit_len >> 11)&0x3);
buffer[4] = (au_arg.unit_len >> 3)&0xff;
//buffer[5] = 0xff & (((uint8_t)(au_arg.unit_len & 0x7)) << 5);
buffer[5] = 0x1f | (((uint8_t)(au_arg.unit_len & 0x7)) << 5);
buffer[6] = 0xfc;

fwrite(buffer,1,sizeof(buffer),file_audio);
fwrite(frame_buf,1,frame_len,file_audio);

but mplayer and faad2 can not work all the time;
Any suggestion will be welcome!



More information about the MPlayer-dev-eng mailing list