[Libav-user] How can i encode s16/s16p to acc
Andy Shaules
bowljoman at gmail.com
Sat Dec 24 01:39:17 EET 2016
On 12/23/2016 3:53 AM, He Lei wrote:
>
> FFMpeg codes is clone from git, that is version 3.0
>
> I cross Compile to the win32 platform;
>
> And enabled these encoders/decoders:
>
> aac,s16be,s16le,s16be_planar,s16le_planar
>
> Enabled muxers/demuxers:
>
> s16be,s16le,s16be_planar,s16le_planar
>
> None of the other.
>
> But, I found aac encoder only support fltp;
>
> My src:
>
> m_pCodec = avcodec_find_encoder(AV_CODEC_ID_AAC); //only fltp
> in m_pCodec->sample_fmts
>
> m_pCodecCtx = avcodec_alloc_context3(m_pCodec);
>
> avcodec_get_context_defaults3(m_pCodecCtx, m_pCodec);
>
> m_pCodecCtx->bit_rate = 6400;
>
> m_pCodecCtx->sample_fmt = AV_SAMPLE_FMT_S16S
>
> m_pCodecCtx->sample_rate = 44100;
>
> m_pCodecCtx->channel_layout = AV_CH_LAYOUT_STEREO;
>
> m_pCodecCtx->channels =
> av_get_channel_layout_nb_channels(m_pCodecCtx->channel_layout);
>
> iRet = avcodec_open2(m_pCodecCtx, m_pCodec, NULL); //return -22!!
>
>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
use a sound wave resampler context from s16 to fltp at the same khz.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20161223/0bb2b37e/attachment.html>
More information about the Libav-user
mailing list