[Libav-user] Regarding AAC to PCM conversion

Gitanshu Mehndiratta gitanshu39 at gmail.com
Fri Aug 9 18:19:21 EEST 2019


I am facing similar problem as explained in

My target is to convert AAC, fltp format to PCM, S16 format.

when i convert AAC to PCM it plays well but a lot of noise is added. I
tried solution given in link but it did not worked for me.

Does any body know the proper fix of this problem?.

Below is my output AVCodecContext used in swr_alloc_set_opts() and

AVCodec *out_codec = avcodec_find_encoder(*AV_CODEC_ID_PCM_S16LE*);

*if* (!out_codec) {

*return* -1;


out_codec_ctx = avcodec_alloc_context3(out_codec);

out_codec_ctx->profile        = FF_PROFILE_UNKNOWN;

out_codec_ctx->channels       = in_codec_ctx->channels;

out_codec_ctx->sample_rate    = in_codec_ctx->sample_rate ;

out_codec_ctx->channel_layout =

out_codec_ctx->sample_fmt     = out_codec->sample_fmts[0];  //

out_codec_ctx->bit_rate       = in_codec_ctx->bit_rate;

out_codec_ctx->frame_size  = codecpar->frame_size;

Any suggestion/pointers are appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20190809/66ca14a1/attachment.html>

More information about the Libav-user mailing list