Thing goes well with frameLength 1024 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).