IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
How do I get frameLength from packets from FFmpeg?, [split from “AAC Bitstream format”, thread 97442/TOS #5]
trungnq
post Feb 27 2013, 10:40
Post #1





Group: Members
Posts: 4
Joined: 27-February 13
Member No.: 106912



Hi all,

I use ffmpeg to generate adts stream:

ffmpeg -re -i input.mp3 -acodec aac -strict experimental -ab 64k -f adts tcp://localhost:1234

I have a sequence of packets with different size (normally around 200bytes each). I can extract the adts header with 7 bytes by following this http://wiki.multimedia.cx/index.php?title=ADTS (by the way, do anybody know about the field calls "Buffer fullness" in ADTS header?).

To decode (using http://labs.official.fm/codecs/aac/) I need to know frameLength, but I don't know how to get this value from packets I receive from ffmpeg. As I understand, frame length is the number of samples in one frame. I don't know if it's correct or not (please correct me if I am wrong). The packets are varies in size, does it mean the frameLength is not fixed for ADTS packets?

Thanks a lot in advance!!

--Trung

Go to the top of the page
+Quote Post
trungnq
post Feb 27 2013, 17:42
Post #2





Group: Members
Posts: 4
Joined: 27-February 13
Member No.: 106912



After googling around, I see the frameLength is always 1024 (samples in a frame). I am going to test the decoder, see if it works.
Go to the top of the page
+Quote Post
trungnq
post Feb 28 2013, 10:43
Post #3





Group: Members
Posts: 4
Joined: 27-February 13
Member No.: 106912



Thing goes well with frameLength 1024 smile.gif

But one strange thing with ffmpeg is, sometimes it generates some big adts packet. Normally adts packet with 64kbs is around 200bytes per frame, but sometimes, I get 1000+bytes packet. This make the sound a bit weird (at least with my decoder). But in the adts header, the actual frame size is much smaller than 1000+bytes. So there are some redundant bytes (don't know what does it use for).
Go to the top of the page
+Quote Post
trungnq
post Mar 1 2013, 10:03
Post #4





Group: Members
Posts: 4
Joined: 27-February 13
Member No.: 106912



It seems there is no problem when I use ffmpeg with -acodec libfaac.

QUOTE (trungnq @ Feb 28 2013, 10:43) *
Thing goes well with frameLength 1024 smile.gif

But one strange thing with ffmpeg is, sometimes it generates some big adts packet. Normally adts packet with 64kbs is around 200bytes per frame, but sometimes, I get 1000+bytes packet. This make the sound a bit weird (at least with my decoder). But in the adts header, the actual frame size is much smaller than 1000+bytes. So there are some redundant bytes (don't know what does it use for).

Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 25th October 2014 - 00:41