Encode audio to aac with libavcodec

江枫思渺然 提交于 2019-11-28 20:45:12

The problem seems to go away if the bitrate is less than 386000. Not sure why this is, as I can encode at bitrates higher than that using FAAC directly. But 128000 is good enough for my purposes, so I'm able to move forward.

I'm attempting to compress in aac format too an have some other problems in encoding. There are some features in last revision of ffmpeg (2.8.0). In first, did you check if the sample format is supported ? In my version the only supported format is AV_SAMPLE_FMT_FLTP. Format checking is in example:

/* check that a given sample format is supported by the encoder */ int check_sample_fmt(AVCodec *codec, enum AVSampleFormat sample_fmt) { const enum AVSampleFormat *p = codec->sample_fmts;

while (*p != AV_SAMPLE_FMT_NONE) {
    if (*p == sample_fmt)
        return 1;
    p++;
}
return 0;

}

If you observe supported formats, only AV_SAMPLE_FMT_FLTP is supported by AAC codec. You should use swresample (as suggested) to convert in planare float format, or you can do it by hand. You should use avcodec_open2 with options strict sperimental in order to open codec. regards

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!