I want to decode some audio streams in the format aac. I already found an example of MP3 and MP2 decoding here: http://ffmpeg.org/doxygen/trunk/decoding__encoding_8c-source.html at line 236. But this code doesn't work for files in the format aac. I only want the raw data, so the decoding from aac into raw data, but i don't find anything. Anyone here with help? With the demuxing.c code: http://www.ffmpeg.org/doxygen/trunk/doc_2examples_2demuxing_8c-example.html the aac data decodes, but I can't play it. I often read that it don't decode in the pcm s16le format?
Asked
Active
Viewed 4,640 times
0
-
You should refer to the examples that come with your ffmpeg source in `doc/examples/` The online docs and examples are kept in sync with the most current code. – llogan Dec 04 '13 at 18:15
2 Answers
0
It would probably be easier to use libavformat to configure your codecContext for you rather than manually.
If it decodes to something than s16le, you can use swresample to change the sample format to anything you want.
If you are struggling with libav*, you should probably now be looking at the examples you provided. They assume you know a lot about media decoding already. The http://dranger.com/ffmpeg tutorial may be better for you.

szatmary
- 29,969
- 8
- 44
- 57
-
In libavcodec there is a file "aacdec.c" and there is a function aac_decode_frame, but when I compile my c++ programm with this c file in my includes in my header, there comes over 200 errors. How can I implement this c file in my programm? – user2492388 Dec 05 '13 at 10:59
-
If you are looking for a standalone aac decoder, use faad instead of libavcodec. – szatmary Dec 05 '13 at 19:13
-3
If you need a professinal solution, go to MainConcept, but their decoder isn't free.

Danijel
- 8,198
- 18
- 69
- 133
-
FFmpeg has a fully-featured AAC decoder that he's already using, there's no reason to pay for a commercial one unless you're looking for the corporate support on top of it. The post is 1.5 years old, but the reason he can't play the data is because the aac decoder doesn't decode to (interleaved) s16le, but to (planar) float, so you need to convert (planar) float to (interleaved) s16le (using e.g. libswresample) before you can play it the same way you'd play a pcm/mp3 file. – Ronald S. Bultje Jul 16 '15 at 10:58
-
(And to check what format something decodes in, check AVCodecContext->format or AVFrame->format) – Ronald S. Bultje Jul 16 '15 at 11:15