[FFmpeg-user] Using amerge to convert dual mono to stereo
tim.nicholson at bbc.co.uk
Fri Jan 13 08:59:55 CET 2012
On 12/01/12 18:01, Nicolas George wrote:
> Le tridi 23 nivôse, an CCXX, Tim Nicholson a écrit :
>> I am trying to use the amerge filter to convert dual mono to stereo,
>> but get a warning from amerge:-
>> "[amerge @ 0x1933a80] Inputs overlap: output layout will be meaningless"
>> and sure enough what I get is stream 1 on both channels of the
>> stereo output with no stream 2 at all....
> It is not a matter of having twice stream #1. It is a matter of having twice
> a front center stream. Internally, most places in ffmpeg where audio
> channels are handled, there is an additional field to mark what channel they
> are. A stream with one channel marked "front center" is not the same thing
> as a stream with one channel marked "back left".
The source material was an MXF file. All audio in mxf is one channel per
stream (flagged as mono afaik). Each stream was audibly identified so I
could check that the output was as expected.
> There is a hardcoded order for the channels: first front left, then front
> right, etc.
> amerge takes that into account whenever possible: if you merge two streams
> with several channels, it reorders them as necessary. For example if your
> first stream has front and back left, and the second has front and back
> right, then the back left from the first stream will come after the front
> right from the first.
> Unfortunately, if there is a channel that appears on both streams, it can
> not work, as amerge does not mix (and we would not want it to). Instead, it
> disregards completely the layout, assuming it is wrong.
My command line was based on the workaround proposed by Clément to
enable one to use use amerge to "merge a media file with 2 mono audio
streams into one single stereo channel audio stream (and keep the video
> If you get that warning, you have to examine carefully the output to see if
> the channels are in the right order.
They were not.
> Another possibility would be to use aformat, or maybe pan, to correctly flag
> the layout for each stream before feeding them to amerge.
If this is the case then the proposed workaround is too simple to
achieve the desired result, and the required workaround likely to be too
complicated for general use for such a simple requirement.
>> [amerge @ 0x1933a80] Inputs overlap: output layout will be meaningless
>> [amerge @ 0x1933a80] in1:mono + in2:mono -> out:stereo
> In this particular trivial case, the first input is mapped to the left and
> the second output is mapped to the right. Maybe (probably) it is what you
> want; maybe not (first input is front center, second input is subwoofer).
Well what I wanted was the first mono stream to be left and the second
mono stream to be right. What I got was the first mono stream on both
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
More information about the ffmpeg-user