Specified sample format -1 is invalid or not supported

简介: Specified sample format -1 is invalid or not supported

ffmpeg本身自带的aac并不支持AV_SAMPLE_FMT_S16的,需要重采样为AV_SAMPLE_FMT_FLTP。如果没有重采样可能报错:

Specified sample format s16 is invalid or not supported


但如果不想重采样也可以换编码器,比如fdk-aac,这是个比ffmpeg本身更优的编码器,也是主流选择之一。之前专门写过一篇关于编译安装fdk-aac的博客。

附链接:

https://blog.csdn.net/weixin_43466192/article/details/120843342


但我使用了fdk-aac,AV_SAMPLE_FMT_S16格式后。之前在ubuntu16下并无问题。把环境移植到centos7后,出现了错误:

Specified sample format -1 is invalid or not supported


查看宏发现AV_SAMPLE_FMT_S16是1而不是-1,就开始怀疑是版本问题。

使用命令查看我编译的可执行文件Capture

ldd Capture


发现它连接的fdk-aac库并不是我编译后放在/usr/local/lib中的库,

而是/usr/local/lib64中的一个fdk-aac库,说明使用了centos7自带的库了,立马卸载系统自带的库:

yum remove fdk-aac


重新编译可执行文件Capture后执行:

ldd Capture


发现它去/usr/local/lib中去连接fdk-aac了。

也不会报错了。



相关文章
HALCON error #1302: Wrong value of control parameter: 2 in operator affine_trans_region
HALCON error #1302: Wrong value of control parameter: 2 in operator affine_trans_region
|
算法 C# C++
HALCON error #1201: Wrong type of control parameter: 1 in operator threshold
HALCON error #1201: Wrong type of control parameter: 1 in operator threshold
Invalid mapping pattern detected: /download/{{fileName}} ^Not allowed to nest variable c
Invalid mapping pattern detected: /download/{{fileName}} ^Not allowed to nest variable c
|
8月前
|
前端开发
Google Earth Engine(GEE)——argument ‘input‘: Invalid type. Expected type: Image<unknown bands>错误
Google Earth Engine(GEE)——argument ‘input‘: Invalid type. Expected type: Image<unknown bands>错误
87 0
|
8月前
|
Perl
报错:error Parsing error: x-invalid-end-tag
报错:error Parsing error: x-invalid-end-tag
167 0
|
8月前
|
Python
完美解决丨ValueError: time data ‘2018/12/24‘ does not match format ‘%Y/%m/%d‘
完美解决丨ValueError: time data ‘2018/12/24‘ does not match format ‘%Y/%m/%d‘
|
前端开发 数据库
Failed to load response dataNo data found for resource with given identifier
Failed to load response dataNo data found for resource with given identifier
1780 0
Optional int parameter ‘id‘ is present but cannot be translated into a null value due to being ……
Optional int parameter ‘id‘ is present but cannot be translated into a null value due to being ……
334 0
FFmpeg Invalid data found when processing input
FFmpeg Invalid data found when processing input
565 0

热门文章

最新文章