基于Android的FFmpeg中AAC解码

基于Android的FFmpeg中AAC解码,android,ffmpeg,decoding,aac,Android,Ffmpeg,Decoding,Aac,我正在尝试使用AAC在Android设备上解码M4A文件 我使用以下代码初始化编解码器 codec = avcodec_find_decoder(CODEC_ID_AAC); c= avcodec_alloc_context(); avcodec_open(c, codec); 但是,当我稍后尝试使用以下方法解码帧时: len = avcodec_decode_audio3(c, (short *)mOutbuf, &out_size, &avpkt); 我在日志中得到-1(

我正在尝试使用AAC在Android设备上解码M4A文件

我使用以下代码初始化编解码器

codec = avcodec_find_decoder(CODEC_ID_AAC);
c= avcodec_alloc_context();
avcodec_open(c, codec);
但是,当我稍后尝试使用以下方法解码帧时:

len = avcodec_decode_audio3(c, (short *)mOutbuf, &out_size, &avpkt);
我在日志中得到-1(表示错误)和以下内容

10-11 16:30:01.115: INFO/M4ADecoder(5260): channel element 0.0 is not allocated
10-11 16:30:02.195: INFO/M4ADecoder(5260): channel element 2.0 is not allocated
10-11 16:30:03.295: INFO/M4ADecoder(5260): channel element 0.6 is not allocated
10-11 16:30:07.645: INFO/M4ADecoder(5260): Sample rate index in program config element does not match the sample rate index configured by the container.
10-11 16:30:07.655: INFO/M4ADecoder(5260): Number of bands (3) exceeds limit (2).
设置编解码器时,我还需要执行其他步骤吗?在将数据发送到AAC解码器之前,是否需要准备文件


同样的文件可以在Mac OSX上使用最新的ffmpeg代码(即ffmpeg-i filename.m4a”)。

您找到解决方案了吗?我有同样的问题,解码AAC-“不支持通道元素”