C++ 使用ffmpeg和C获取音频样本,官方示例代码错误
对于使用mingw-w64的开发人员,我使用的是ffmpeg v。4.3.1. 以及ffmpeg的最新Git版本(Zeranoe的Windows64版本) 我在运行官方的音频解码示例代码时遇到了“奇怪”的问题 MP3DirectCut(自由低音)。mp3 生成pcm,但输出:C++ 使用ffmpeg和C获取音频样本,官方示例代码错误,c++,c,api,audio,ffmpeg,C++,C,Api,Audio,Ffmpeg,对于使用mingw-w64的开发人员,我使用的是ffmpeg v。4.3.1. 以及ffmpeg的最新Git版本(Zeranoe的Windows64版本) 我在运行官方的音频解码示例代码时遇到了“奇怪”的问题 MP3DirectCut(自由低音)。mp3 生成pcm,但输出: "Warning: the sample format the decoder produced is planar (s16p). This example will output the first ch
"Warning: the sample format the decoder produced is planar (s16p).
This example will output the first channel only."
但是输出pcm有两个通道
使用ffmpeg(4.1.4,无错误消息)将上述mp3重新编码为wav时
而且在将后者重新编码为mp3时
示例代码中断并生成以下错误消息:
avcodec_send_packet ()
from within:
"[mp2 @ <someAddress>] Header missing"
and returns error code -1094995529
(= "Invalid data found when processing input")
avcodec\u发送\u数据包()
从内部:
“[mp2@]标头丢失”
并返回错误代码-1094995529
(=“处理输入时发现无效数据”)
它会为所有其他格式生成错误消息
我试过了,当我与另一位编辑合作时(海选3.0)。
但是所有的文件在我所有的程序中都播放和显示得很好
我现在不知所措。
这到底是怎么回事