使用 libav (avconv) 或 ffmpeg 的多通道 AAC mp4 编码

Multichannel AAC mp4 encoding using libav (avconv) or ffmpeg

我正在尝试使用 AAC 编码创建一个四声道 mp4 文件以供 Ambisonics 使用。我正在尝试将 4 通道一阶立体声 wav 文件编码为 AAC,如下所示:

avconv -i four_channel_input.wav -c:a libfaac -ac 4 four_channel_output.mp4

这给了我错误

[libfaac @ 0x7f938885a000] Specified channel_layout is not supported
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

删除 -ac 4 选项给我一个 5 通道文件

Duration: 00:01:21.09, start: 0.021333, bitrate: 218 kb/s
Stream #0:0(und): Audio: aac (LC) [mp4a / 0x6134706D]
  48000 Hz, 5.0, fltp, 215 kb/s (default)

第一个通道是空白的,这显然不是最理想的。为了创建 压缩的 Ambisonics 文件,我是否应该使用像 AmbiX 这样的单独格式(即使我认为这是未压缩的)?

使用ffmpeg,你可以运行

ffmpeg -i input.wav -c:a aac -ac 4 -channel_layout 4.0 four_channel_output.mp4