[Libav-user] Issue in Decoding AMR

NITIN GOYAL nitinkumgoyal at gmail.com
Thu Feb 9 11:45:15 CET 2012


Hi

I am trying to decode some Amrnb audio using the avcodec_decode_audio3
function. I want to input frame by frame and save the raw output frame by
frame as well.

*int len = avcodec_decode_audio3(mpCodecContext, (short *)outbuf,
&out_size, &pkt);*

Now, the issue is that when I give the input of a frame of 32 bytes without
the AMR header, i got the len >0, but the outsize value is always 640 that
I am sure is not correct and I am also able to read the 640 values in the
output buffer.

When i try to extract the raw audio from my media file, using the
standalone ffmpeg windows build i get a different output, which is correct.
I have used the following command:

*ffmpeg -i input.amr -f amr Output.raw*
*
*
*Now, I am not sure if the output of **avcodec_decode_audio3 function **is
correct or  not as even if i send the bugger input say 64 byte or 128 or
the whole while at one go, the output buffer size is always 640 bytes.*
*
*
*Can someone let me know where I am doing the mistake for the same as I
want the same out as the standalone .*
*
*
*I have the sample attached which I am trying to decode also I have
attached the sample code which I am using to decode.*
*
*
*
*
*
*
*Regards*
*Nitin*
*
*
*
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120209/0ec7d733/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sound2.amr
Type: application/octet-stream
Size: 8701 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120209/0ec7d733/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample_code.cpp
Type: text/x-c++src
Size: 1396 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120209/0ec7d733/attachment.bin>


More information about the Libav-user mailing list