[Libav-user] Encode PCM16 to AAC
Carl Eugen Hoyos
ceffmpeg at gmail.com
Wed Mar 14 00:45:56 EET 2018
2018-03-13 17:16 GMT+01:00, Michael IV <explomaster at gmail.com>:
> Hi. I have a PCM 16 bit (signed) stream,which I want to encode using AAC
> Now I am following the setup of audio encoding example and where I check
> SAMPLE FMT support by the codec,the check fails:
> while (*p != AV_SAMPLE_FMT_NONE)
> if (*p == c->sample_fmt)
> Because AAC codec which I opened contains only AV_SAMPLE_FMT_FLTP
> Does it mean I can't use audio data as PCM16 to encode with AAC?
Yes, either use the aresample filter to convert from pcm_s16le to pcm_flt
or use libswresample directly.
More information about the Libav-user