tags:

views:

1023

answers:

1

Hello, I want to decode a WMA stream to 16 Bit PCM. Now i have a Question concerning FFMpeg- what is the output format of ..

len = avcodec_decode_audio2(c, (int16_t *)outbuf, &outbuf_used, inbuf_ptr, size);

is this the right function for this task?

Thank you

+2  A: 

Hi,

A remark : try to ask this question on ffmpeg user list. You will certainly find ffmpeg gurus there.

I mainly use ffmpeg to encode/decode video. To decode, the "avcodec_decode_*" are the right things to use for ... decoding. What you get is ... 16 bits PCM.

What I mean is that decoding a multimedia stream can be tricky and ffmpeg is quite a low level lib. It is hard to be more precise with just the line of code you give (at least you should be more precise about your parameters).

What you should be careful about is that when reading multimedia stream, you have to demux you stream first (sometimes even if there is only one stream in your container) and then to decode it with the right codec. If you have correctly demuxed your stream, correctly initialized your codec / codec context then you can call avcodec_decode and it will works :)

As you mention c++ in your tags, you can try a c++ wrapping for ffmpeg : FOBS The use is much more simple but of course, you lose precise control ...

I hope it helps.

neuro