我需要将两个音频文件合并为一个。使用 -filter_complex amix=inputs=2 可以轻松完成此操作。但是,尽管两个音频文件的音量调节正确,但有时合并它们会导致削波。
我尝试添加可以独立工作的 -filter_complex alimiter,但两者结合在一起时出现错误“无法在过滤器 Parsed_alimiter_0 上找到未标记输入 pad 0 的匹配流”
如果有人能建议如何最好地做到这一点,我将不胜感激。我希望限制在 -1dB 左右。
编辑:根据要求,输出如下:
N:\>ffmpeg -i outr20.wav -i outr20t03.wav -filter_complex amix=inputs=2 -filter_complex alimiter output.wav
ffmpeg version N-78964-g5061579 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 19.100 / 55. 19.100
libavcodec 57. 28.100 / 57. 28.100
libavformat 57. 28.100 / 57. 28.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 39.102 / 6. 39.102
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, wav, from 'outr20.wav':
Metadata:
encoder : Lavf57.28.100
Duration: 00:07:13.18, bitrate: 128 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000 Hz, 1 channels, s16, 128 kb/s
Guessed Channel Layout for Input Stream #1.0 : mono
Input #1, wav, from 'outr20t03.wav':
Metadata:
encoder : Lavf57.28.100
Duration: 00:07:13.18, bitrate: 128 kb/s
Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000 Hz, 1 channels, s16, 128 kb/s
Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_alimiter_0
答案1
两个过滤器必须在同一个链中指定,即
ffmpeg -i outr20.wav -i outr20t03.wav \
-filter_complex \
"[0][1]amix=inputs=2[m];[m]alimiter[a]" \
-map [a] output.wav