[Libav-user] How to specify the audio sample format when opening a file
xuanyu.huang at gmail.com
Wed Feb 6 04:56:45 CET 2013
I'm upgrading our application from using FFMPEG v0.8.5 to latest version.
As new audio sample formats were introduced in libavutil/samplefmt.h. Now
we have both packed format and planar format.
Our application, when used with old version to open a MP4 file with AAC
encoded audio, the populated pAudioCodecCtx->sample_fmt ==
AV_SAMPLE_FMT_FLP, but when used with latest FFMPEG version, this value
changed to AV_SAMPLE_FMT_FLTP.
I found a member AVCodecContext::request_sample_fmt which is said can be
set by user.
So my question is, how to set it when opening a file.
Here is the steps in our application to open a file.
1. avformat_open_input to open a file
2. avcodec_find_decoder get a pointer to AVCodec
3. call avcodec_open to open codec
could anybody tell me where to set the requested sample fmt?
And if anyone can provide the conversion function from packed data to
planar data, I'll be so grateful.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user