其他分享
首页 > 其他分享> > ffmpeg编码报错:more samples than frame size (avcodec_encode_audio2)

ffmpeg编码报错:more samples than frame size (avcodec_encode_audio2)

作者:互联网

fkd_aac默认有好几种采样范围,如下:
2048 HE-AAC v1/v2
1024: Default configuration.//AAC-LC 1024
512: Default length in LD/ELD configuration.
480: Length in LD/ELD configuration.
256: Length for ELD reduced delay mode (x2).
240: Length for ELD reduced delay mode (x2).
128: Length for ELD reduced delay mode (x4).
120: Length for ELD reduced delay mode (x4).
但是默认的是1024,所有如果把带有多于1024的音频采样数送进编码器的话,就会报错:

more samples than frame size (avcodec_encode_audio2)

同时如果使用默认值1024的话,也不能少于1024,必须正好是1024,否则值越小音频质量会越差,设置听不到声音,因为当送进去的值不够1024时,编码器会补充一些无效值来凑够这个数据,因此播放就会 出现问题。
更多fdk_aac见另一篇博文:libfdk_aac音频采样数和编码字节数注意

标签:1024,ffmpeg,frame,ELD,delay,Length,报错,mode,reduced
来源: https://blog.csdn.net/weixin_43466192/article/details/121594888