[FFmpeg-user] Is swr_convert() able to resample the audio from 1 channel to 2 channels?

JIA Pei jp4work at gmail.com
Tue Feb 19 16:14:30 CET 2013


Hi, all:

Sorry for my naive questions. I'm trying to decode audio stream using
avcodec_decode_audio4(). After I obtained the audio frame by
avcodec_decode_audio4(), I'd love to resample audio signals using
swr_convert() ----

its definition is pasted as follows:

int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,

                                const uint8_t **in , int in_count);



Now, my question:
1) is swr_convert() able to convert audio signals from 1 channel to 2
channels ????
2) for swr_convert(), if there are 2 audio channels (stereo audio signals),
how is the data organized in unit8_t **out?
Does out[0] only contain the left channel audio signals?
Does out[1] contain the right channel audio signals?
Why in my case, out[1] always points to NULL ?


Please do help... Thank you...


Best Regards

-- 

Pei JIA

Email: jp4work at gmail.com
cell:    +1 604-362-5816

Welcome to Vision Open
http://www.visionopen.com


More information about the ffmpeg-user mailing list