[FFmpeg-user] Audio mapping and mixing

Media Mouth communque at gmail.com
Sun Jun 9 19:51:03 EEST 2024


Following up on an earlier post "amix vs amerge / how to" but now testing on ffmpeg version 7.0.1

The overall goal here is to learn how (if possible) to take source files with 10 - 20 audio channels and mixdown / assign those in various ways to -- 2 channel, 4 channels etc etc -- it depends on the who's requesting the mixdown.

I've been testing with -filter_complex amix, amerge, and join.  I'm not yet sure which is most suitable to the task or whether there are better FFmpeg approaches altogether.

If the goal is to take a source with lots of audio streams and mix those down in any combo, how could that be achieved?
According to the FFmpeg documentation amix "Mixes multiple audio inputs into a single output <https://ffmpeg.org//ffmpeg-filters.html#amix>", which suggests amix is not the best choice?
One post I read suggested 'join' provided more control & flexibility than both 'amerge' and 'amix', so I've been testing with that

I made some progress, but not yet doing mixdowns.  Simply assigning to input streams to the same output track generates an error...

ffmpeg -i SoundTestIn.mxf \
-filter_complex 'join=inputs=4:channel_layout=stereo:map=0.0-FR|1.0-FR|2.0-FL|3.0-FR' \
SoundTestOut.mov

Error: Multiple maps for output channel 'FR'

Perhaps join is NOT the best approach?  Thanks for any insights here.



full output

ffmpeg version 7.0.1 Copyright (c) 2000-2024 the FFmpeg developers
  built with Apple clang version 15.0.0 (clang-1500.3.9.4)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.0.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
[Parsed_join_0 @ 0x600003df4000] Multiple maps for output channel 'FR'.
[AVFilterGraph @ 0x6000021f0000] Error initializing filters
Failed to set value 'join=inputs=4:channel_layout=stereo:map=0.0-FR|1.0-FR|2.0-FL|3.0-FR' for option 'filter_complex': Invalid argument
Error parsing global options: Invalid argument



More information about the ffmpeg-user mailing list