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音频采样数和编码字节数注意


相关文章
|
4月前
|
存储 编解码 数据处理
【FFmpeg 视频基本格式】深入理解FFmpeg:从YUV到PCM,解码到编码(三)
【FFmpeg 视频基本格式】深入理解FFmpeg:从YUV到PCM,解码到编码
157 0
|
4月前
|
存储 编解码 数据处理
【FFmpeg 视频基本格式】深入理解FFmpeg:从YUV到PCM,解码到编码(二)
【FFmpeg 视频基本格式】深入理解FFmpeg:从YUV到PCM,解码到编码
177 0
在某龙芯平台上编译FFMPEG报错:ERROR: xxx not found using pkg-config
在某龙芯平台上编译FFMPEG报错:ERROR: xxx not found using pkg-config
317 0
ffmpeg推流报错Failed to update header with correct duration.
ffmpeg推流报错Failed to update header with correct duration.
613 0
|
Android开发
【错误记录】Android 可执行权限报错 ( Cannot run program “/data/user/0/cn.e/ffmpeg“: error=13,Permission denied )
【错误记录】Android 可执行权限报错 ( Cannot run program “/data/user/0/cn.e/ffmpeg“: error=13,Permission denied )
1859 0
【错误记录】Android 可执行权限报错 ( Cannot run program “/data/user/0/cn.e/ffmpeg“: error=13,Permission denied )
|
4月前
|
前端开发
使用ffmpeg-core的时候报错,解决Uncaught (in promise) ReferenceError: SharedArrayBuffer is not defined
使用ffmpeg-core的时候报错,解决Uncaught (in promise) ReferenceError: SharedArrayBuffer is not defined
|
4月前
|
编解码 API 数据处理
【摄像头数据处理】摄像头数据处理:使用FFmpeg合并、编码和封装视频流
【摄像头数据处理】摄像头数据处理:使用FFmpeg合并、编码和封装视频流
261 0
|
4月前
|
存储 缓存 编解码
【FFmpeg 视频基本格式】深入理解FFmpeg:从YUV到PCM,解码到编码(一)
【FFmpeg 视频基本格式】深入理解FFmpeg:从YUV到PCM,解码到编码
167 0
|
芯片
Mac M1安装ffmpeg报错DependencyNotInstalled: Found neither the ffmpeg nor avconv executables.
Mac M1安装ffmpeg报错DependencyNotInstalled: Found neither the ffmpeg nor avconv executables.
163 0
|
存储 编解码 C++
FFmpeg连载5-音视频编码
ffmpeg连载系列
129 0