Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/157.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 使用ffmpeg和C获取音频样本,官方示例代码错误_C++_C_Api_Audio_Ffmpeg - Fatal编程技术网

C++ 使用ffmpeg和C获取音频样本,官方示例代码错误

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

对于使用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 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)。 但是所有的文件在我所有的程序中都播放和显示得很好

我现在不知所措。 这到底是怎么回事