[FFmpeg-user] Mapping audio for non-surround audio

MediaMouth communque at gmail.com
Mon Dec 4 15:48:00 EET 2023

We've got two sources
One video file (DNxHD36/mxf), no sound
One wav file, 12 - 30 channels

Together these two files are our mezzanine

The goal is to merge the two into one multiple times, each time with different audio mapping

So for instance one merge might be
wav 1 - 14 map to output a1
wav 15-24 map to output a2

Another might be
wav odd channels to output a1
wav even channels to output a2

And yet another might be
wav 1-4 to output a1
wav 5-8 to output a2
wav 9-16 to output a3

Basically what's in our wav channels and how they get mixed and mapped is an ever-changing thing.

Reading the ffmpeg documentation ( https://trac.ffmpeg.org/wiki/AudioChannelManipulation ) I haven't yet made sense of the logic in part because when it comes to mapping multiple channels, the assumption seems to be that you're working with surround and/mixing down to stereo

In our case we're mixing down (or just mapping) from a large number of channels to anything, from mono to 24 tracks, and by googling alone I haven't (yet) figured out how to write the code for that in a reliable / schematic way.

Thanks for any clarity on this.

More information about the ffmpeg-user mailing list