Log in

View Full Version : AAc problem in TS


chits007
3rd March 2006, 16:41
Hi,
I have a TS file which has AVC video and AAC Audio;this played well in mplayer and mplayer tells me about AVC/AAC information.
Now aht I have done is extract the AAC frames in a .aac file and try to figure out which type of AAC decoder can be used.
All the frames are of fixed 720 bytes and its not ADTS also,so what kind of AAC file is this be ?

Is their any tool which can tell me which type of AAC file is this? Also how the encoded frame sizes are fixed ?

unixfs
4th March 2006, 10:02
the only other AAC format that mplayer supports is the one encapsulated in SL streams.
You can save the audio stream to avi with
mencoder -ovc frameno -oac copy -o file.avi file.ts
or even try to mux to a different format using a very recent version of mencoder+libavformat, but surely not as ADTS
(because there's no ADTS framer in mencoder) or raw format of any kind (it would turn out to be totally unplayable).

I'd be really curious to give a look at (part of ) this stream; can you a post a link to download it, please?

chits007
4th March 2006, 13:47
Hi,
Thanks for your reply.
I am uploading the demultiplexed AAC from the transport stream.
All the frame are of euql size 720 bytes.

http://s29.yousendit.com/d.aspx?id=3HTWR1AS8WFR83BZC29L6QTG73

have a lok which AAC format is this
Thanks

unixfs
4th March 2006, 13:52
Hi,
Thanks for your reply.
I am uploading the demultiplexed AAC from the transport stream.
All the frame are of euql size 720 bytes.

http://s29.yousendit.com/d.aspx?id=3HTWR1AS8WFR83BZC29L6QTG73

have a lok which AAC format is this
Thanks

the "audio.aac" sample is plain ADTS

ff f8 58 40 20 41 fc f0 25 01 12 14 2d 15 08 43
0000400 11 08 00 00 00 00 00 21 9f ad 1e d8 b5 41 4b 63
[...]
0000760 83 80 ff f8 58 40 1f c2 00 72 21 01 12 14 2e 10

I don't see the muxed TS, though

chits007
4th March 2006, 15:25
Hi,
Thanks for a quick reply.Ya I also see that after some bytes the ADTS header starts.SO I think the problem is the Transport Stream Demux.I am not demuxing it properly.

Can you point a free Transport Stream Demux by which I can test and it will also point me where I am wrong?

Thanks for all your help

unixfs
4th March 2006, 20:21
what command are you executing to demux? you just need to append -dumpfile audio.aac -dumpaudio.
Anyway mplayer won't start to dump from the beginning of the first frame: just from the first PES payload it finds

chits007
4th March 2006, 21:02
Hi,

I build another audio.aac this time from MPLAYER by running this command.
mplayer x.trp -dumpfile aac.aac -dumpaudio
I repeat the earlier AAC file I uploaded was from my demux program and not from mplayer.

Have a look at this file this file wont be played unless you trail out all the bytes till you get first 0xFFF [sync word]
.If yo cut the earlier protion you will be able to played back.

So the question where is the problem.Is the problem is in the transport stream?

http://s27.yousendit.com/d.aspx?id=2SR0C22PEKT57387MZWLEU2KTD

unixfs
4th March 2006, 21:21
Have a look at this file this file wont be played unless you trail out all the bytes till you get first 0xFFF [sync word]
.If yo cut the earlier protion you will be able to played back.

So the question where is the problem.Is the problem is in the transport stream?

http://s27.yousendit.com/d.aspx?id=2SR0C22PEKT57387MZWLEU2KTD

I can play both the first and the second aac samples perfectly well using mplayer; maybe you are using a different player?
The player's AAC demuxer must be able to search syncwords before decoding the stream; not everyone does.

The samples don't contain errors, so it's very likely that the TS doesn't have errors, either.
Eventual problems are due to the demuxer you are using.

chits007
5th March 2006, 07:37
Hi,
Which version are you using?
I am using
MPlayer 1.0pre7-3.4.2

Also i used this command to playback
mplayer audio.aac

I am unable to play both the file by mplayer,however VLC plays both.
So the whole idea is to look for audio sync and throw al the bytes that precedes the sync byte.?
Thanks for the help.

unixfs
5th March 2006, 09:26
Hi,
Which version are you using?
I am using
MPlayer 1.0pre7-3.4.2


that version is extremely old. Use a fresh cvs checkout, instead


Also i used this command to playback
mplayer audio.aac

I am unable to play both the file by mplayer,however VLC plays both.
So the whole idea is to look for audio sync and throw al the bytes that precedes the sync byte.?
Thanks for the help.

yes

chits007
6th March 2006, 08:50
Hi,
I have one more question.
in my TS packet;I have PES_Start_Unit_Indicator as 1;PES_Packet_Length as 720
The payload in this packet doesn't contain AAC Sync Byte in the begining of the payload;instead it contains the sync byte in the middle .
So my question how do I will do the audio packet framing.
What will you suggest.?

I am also attaching the binary dump of this packet(188 bytes).

unixfs
6th March 2006, 23:29
Hi,
you can't rely on the alignment of the audio payload at the begining of the PES payload.
As for mp2/3 and video you have only one chance: buffer PES payloads and
search syncwords in the buffers, before passing audio frames to the decoder.

silenceboy
21st March 2006, 04:39
For mp2, I think, most time, decoder will do the buffering and search sync words.

medha
25th August 2009, 05:19
HI All,
I am working on a player which decodes and plays audio data. For decoding - we are using FAAD2 decoder.
As it wants the input in terms of frames, the PES(Mpeg-2) data is splitted into frames by using 'aac frame length' field in ADTS variable header.

The issue is - 'aac frame length' field value is not proper -- Eventhough the total PES is of 720bytes, frame length is coming as 6180 bytes..
Please check the following data and see, whether my parsing is proper or not..


8c 02 fa f3 64 35 73 22 d3 b8 c5 e0 15 ca 94 a3 9f 0c 41 1a 40 98 21 94 a6 2f 51 1b a0 35 57 77 52 df 64 8e 59 ca 31 3a 06
9e 95 65 c2 68 68 51 7b c8 5b 02 4f 41 ff f1 60 bf 04 4e b2 84 fd 87 66 6f bf a8 89 f1 ce d6 29 d3 09 be d8 ba 9f f5 9d 2b
30 be 35 00 82 00 74 39 68 d3 c1 a0 36 6e 75 77 d3 1f c2 25 02 99 77 39 63 9f 62 f4 ad ca d6 f5 12 aa ee 89 40 d2 e3 cf b8
da 8f 1d f6 8b 7e 24 c8 b4 65 83 05 43 94 5b 5a a4 b8 86 ce 15 6b 4c 66 b5 83 f6 c6 c0 5e 5a 1c 80 4e 81 02 e0 04 85 d5 20
01 8c 4b 6f 16 60 21 f6 58 49 80 14 99 15 b5 60 06 0e ff f8 58 80 20 c1 f8 6c 5d 25 0a 94 f3 c1 60 24 52 18 9f a1 c6 b2 ab
9d 69 69 39 e3 04 91 15 2a 5b 25 29 a1 1b 7b 0d de 79 ca fb fc b7 c3 2d 2b e4 6d ee 17 5b b3 a4 6b 61 96 38 6e e2 95 33 37
19 9e 8b ce d5 aa 1e 7d 59 a8 92 5e ef 6c 21 69 c4 48 42 c3 be af 7a b0 5d c6 ba 6b 74 bd de 37 d2 63 2b 94 09 2e 63 0e dd
6e 28 00 48 ba d1 3f ee 9e 31 65 a6 44 76 08 15 86 22 64 55 4d ab bb f7 d6 ea b6 b5 a4 80 98 0b 57 7e 77 b1 8d f3 da 22 22
d7 bb 01 80 2d cf 68 18 9c 4e 3d c7 42 02 86 5f e2 73 f7 1d 84 e6 4f 29 a9 5c 7f 08 98 08 3c b5 7b 73 5d 43 55 9a da d7 49
15 11 29 40 7e cf 36 1d 17 4d a4 68 df 7b b5 b4 cc 2a 77 52 82 34 fa 67 ab 12 e7 c0 ef d5 f8 de 4a a5 32 eb d5 43 8b 67 1a
62 59 3a 69 61 01 41 0b 80 8a e0 b0 00 98 00 a4 65 bb bc 00 10 fa a8 59 19 27 82 c9 09 9c 40 03 06 0e ff f8 58 80 23 41 ec
86 84 25 0a 94 f4 a1 90 b0 35 3d f9 ae 25 f9 de f7 aa b8 bc 95 57 bd 4a 48 22 d3 76 58 6e f9 ad 1e 45 4e 7a da 6a 9b e8 b9
93 ef f3 7a 80 a4 9c c8 09 8d d9 31 55 4b b4 ba 35 b3 77 99 af 60 77 7d de 89 48 d7 7f cf 60 5e 70 1a ac 20 a8 aa 9d af 43
35 8a ab 86 91 d1 bc c5 c6 1b ba 58 40 2a 6a 22 c0 04 0b 38 8b cf a2 f4 30 84 ef db c6 3b 03 ac ca a9 b3 68 ec eb 7d 77 55
da fc 19 92 38 e1 a5 6c f2 c5 35 f7 b8 7b 5b 30 8b cb b4 6b 63 e5 70 6b 5a 1e 0c 04 94 ab 4b ed 78 e0 24 53 7d 05 52 fc 22
0x01590B87 80 08 84 26 b8 be e6 f4 2a e0 95 2e aa 25 5d 49 31 16 00 3f 36 51 be fe 14 d6 82 bb 1b cb 26 64 c0 42 82 e0 3b ba 04 15 dd
dd a9 a0 bd d6 20 37 88 49 9f 96 3b b6 6d 42 23 41 2a d3 7b dc c9 33 0b 01 b3 9e 27 76 00 66 85 95 34 00 4a b3 22 45 35 c4
c0 0a cc 0a 01 58 81 20 ac 01 02 84 9b b9 09 01 0f aa db aa 6d de b7


First Sync Byte Data:

ff f1 60 bf 04 4e b2 84 fd 87 66 6f bf a8..
fff - Sync word
1 6 0 b - ADTS fixed header
f - first 2 bits are copy right ID related
so the next 13bits - 11 0000 0100 010 --> 1822hex = 6178 byes
But total PES length is only 720 bytes..

Please let me know, if i am doing anything wrong..

Thanks in advance,
Medha