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了。

也不会报错了。



相关文章
|
7月前
|
算法 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
|
3月前
|
前端开发
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>错误
28 0
Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC
Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC
GenImageInterleaved Wrong type of control parameter 1
GenImageInterleaved Wrong type of control parameter 1
|
9月前
|
前端开发 数据库
Failed to load response dataNo data found for resource with given identifier
Failed to load response dataNo data found for resource with given identifier
1049 0
|
11月前
Newline required at end of file but not found.
Newline required at end of file but not found.
103 0
Newline required at end of file but not found.
FFmpeg Invalid data found when processing input
FFmpeg Invalid data found when processing input
397 0
Dx unsupported class file version 52.0 Conversion to Dalvik format failed with error 1
Dx unsupported class file version 52.0 Conversion to Dalvik format failed with error 1
118 0
成功解决absl.flags._exceptions.UnrecognizedFlagError: Unknown command line flag 'data_format'
成功解决absl.flags._exceptions.UnrecognizedFlagError: Unknown command line flag 'data_format'
|
编解码 定位技术
Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决
Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决
260 0
Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决