[FFmpeg-user] Query on audio_decode_example() in api-example.c

Prashant Rathi prashant at b-one.net
Sun Apr 10 16:02:07 CEST 2011

Hi FFMPEG Users,


I am new to FFMPEG. My requirement is to convert any given input audio file
to .wav pcm format by using FFMPEG API's.

I tried using api-example.c code given for audio_decode_example() .


Input to this api is outfilename and filename.


Outfilename: I have given path to some location\test.wav

Filename: I have given path to m4a file available on my system.



But it always fails at avcodec_decode_audio3() call. This call always
returns -1 with following console message for m4a files as input.


Channel 0.0 is not allocated


I tried to convert mp3 file to wav also using the same approach as above but
again it failed at same api call with "Header Missing " message.


Please support me with right code to meet my requirements.


I want API usage not console command to do this.


Thanks in advance!


More information about the ffmpeg-user mailing list