为什么 ffmpeg 警告 "Guessed Channel Layout for Input Stream #0.0 : mono"?
Why is ffmpeg warning "Guessed Channel Layout for Input Stream #0.0 : mono"?
我正在使用 ffmpeg 读写原始音频 to/from 我的 python 脚本。我使用的保存和加载命令都会产生警告“Guessed Channel Layout for Input Stream #0.0 : mono”?尽管事实上我在输入和输出之前使用 -ac 1
告诉 ffmpeg 只有一个通道。我在应该设置 -guess_layout_max 0
的地方看到了一些其他答案,但这似乎是一个 hack,因为我不想让 ffmpeg 猜测;我用 -ac 1
准确地告诉它有多少个频道。应该不用猜了。
我的保存命令格式如下,r
是采样率,f
是我要将原始音频保存到的文件。我正在通过管道从 python 通过标准输入发送原始音频。
ffmpeg_cmd = 'ffmpeg -hide_banner -loglevel warning -y -ar %d -ac 1 -f u16le -i pipe: -ac 1 %s' % (r, shlex.quote(f))
同样,我的加载命令如下,ffmpeg 从 f
读取并将原始音频写入标准输出。
ffmpeg_cmd = 'ffmpeg -hide_banner -loglevel warning -i %s -ar %d -ac 1 -f u16le -c:a pcm_u16le -ac 1 pipe:' % (shlex.quote(f), r)
-ac
设置没有。通道数,而不是它们的布局,通道数的每个值可以有多个。
使用选项 -channel_layout
。
ffmpeg -hide_banner -loglevel warning -y -ar %d -ac 1 -channel_layout mono -f u16le -i pipe: ...
我正在使用 ffmpeg 读写原始音频 to/from 我的 python 脚本。我使用的保存和加载命令都会产生警告“Guessed Channel Layout for Input Stream #0.0 : mono”?尽管事实上我在输入和输出之前使用 -ac 1
告诉 ffmpeg 只有一个通道。我在应该设置 -guess_layout_max 0
的地方看到了一些其他答案,但这似乎是一个 hack,因为我不想让 ffmpeg 猜测;我用 -ac 1
准确地告诉它有多少个频道。应该不用猜了。
我的保存命令格式如下,r
是采样率,f
是我要将原始音频保存到的文件。我正在通过管道从 python 通过标准输入发送原始音频。
ffmpeg_cmd = 'ffmpeg -hide_banner -loglevel warning -y -ar %d -ac 1 -f u16le -i pipe: -ac 1 %s' % (r, shlex.quote(f))
同样,我的加载命令如下,ffmpeg 从 f
读取并将原始音频写入标准输出。
ffmpeg_cmd = 'ffmpeg -hide_banner -loglevel warning -i %s -ar %d -ac 1 -f u16le -c:a pcm_u16le -ac 1 pipe:' % (shlex.quote(f), r)
-ac
设置没有。通道数,而不是它们的布局,通道数的每个值可以有多个。
使用选项 -channel_layout
。
ffmpeg -hide_banner -loglevel warning -y -ar %d -ac 1 -channel_layout mono -f u16le -i pipe: ...