[FFmpeg-devel] [PATCH] doc: document amerge filter as an alternative for the -map_channel limitation.

Clément Bœsch ubitux at gmail.com
Wed Jan 11 16:48:34 CET 2012


On Tue, Jan 10, 2012 at 03:45:18PM +0000, Tim Nicholson wrote:

Hi Tim,

> ----- Original Message -----
> > From: Clément Bœsch <ubitux at gmail.com>
> > To: ffmpeg-devel at ffmpeg.org
> > Cc: Clément Bœsch <clement.boesch at smartjog.com>
> > Sent: Tuesday, 10 January 2012, 10:52
> > Subject: [FFmpeg-devel] [PATCH] doc: document amerge filter as an alternative for the -map_channel limitation.
> > 
> > From: Clément Bœsch <clement.boesch at smartjog.com>
> > 
> > ---
> > doc/ffmpeg.texi |   19 +++++++++++++++++++
> > 1 files changed, 19 insertions(+), 0 deletions(-)
> > 
> > diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
> > index 83a45a8..f4df331 100644
> > --- a/doc/ffmpeg.texi
> > +++ b/doc/ffmpeg.texi
> > @@ -833,6 +833,25 @@ possible, for example, to turn two separate mono streams 
> > into a single stereo
> > stream. However spliting a stereo stream into two single channel mono streams
> > is possible.
> > 
> > +If you need this feature, a possible workaround is to use the @emph{amerge}
> > +filter. For example, if you need to merge a media (here @file{input.mkv}) with
> > +6 mono audio streams into one single 5.1 channel audio stream:
> 
> Would it not be better initially to give an example of the previous example (sic), e.g turning dual mono into stereo?

As you wish, changed.

> And preferably from a file also containing video so it is clear how to use it instead of the "map_channel", then it
> looks like a workaround for the case in point.
> 

OK.

> I think that more comprehensive samples (with the complete command line as you do) could then go in the actual amerge
> section which is somewhat terse and lacking enough examples to make the syntax clear for all cases.

I moved the current example to the amerge section.

Note that this will likely be changed "soon" again because of the
incoming remapchannel filter.

-- 
Clément B.
-------------- next part --------------
From 75fc29d3c6cc3e2e0626bb9db4a605fe51261922 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <clement.boesch at smartjog.com>
Date: Tue, 10 Jan 2012 11:47:46 +0100
Subject: [PATCH] doc: document amerge filter as an alternative for the
 -map_channel limitation.

---
 doc/ffmpeg.texi  |   12 ++++++++++++
 doc/filters.texi |   17 +++++++++++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index 83a45a8..417e68b 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -833,6 +833,18 @@ possible, for example, to turn two separate mono streams into a single stereo
 stream. However spliting a stereo stream into two single channel mono streams
 is possible.
 
+If you need this feature, a possible workaround is to use the @emph{amerge}
+filter. For example, if you need to merge a media (here @file{input.mkv}) with 2
+mono audio streams into one single stereo channel audio stream (and keep the
+video stream):
+
+ at example
+ffmpeg -i input.mkv -f lavfi -i "
+amovie=input.mkv:si=1 [a1];
+amovie=input.mkv:si=2 [a2];
+[a1][a2] amerge" -c:a pcm_s16le -c:v copy output.mkv
+ at end example
+
 @item -map_metadata[:@var{metadata_type}][:@var{index}] @var{infile}[:@var{metadata_type}][:@var{index}] (@emph{output,per-metadata})
 Set metadata information of the next output file from @var{infile}. Note that
 those are file indices (zero-based), not filenames.
diff --git a/doc/filters.texi b/doc/filters.texi
index d0075f2..82397fe 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -189,6 +189,23 @@ Example: merge two mono files into a stereo stream:
 amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
 @end example
 
+If you need to do multiple merges (for instance multiple mono audio streams in
+a single video media), you can do:
+ at example
+ffmpeg -f lavfi -i "
+amovie=input.mkv:si=0 [a0];
+amovie=input.mkv:si=1 [a1];
+amovie=input.mkv:si=2 [a2];
+amovie=input.mkv:si=3 [a3];
+amovie=input.mkv:si=4 [a4];
+amovie=input.mkv:si=5 [a5];
+[a0][a1] amerge [x0];
+[x0][a2] amerge [x1];
+[x1][a3] amerge [x2];
+[x2][a4] amerge [x3];
+[x3][a5] amerge" -c:a pcm_s16le output.mkv
+ at end example
+
 @section anull
 
 Pass the audio source unchanged to the output.
-- 
1.7.7.3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120111/190dfa4d/attachment.asc>


More information about the ffmpeg-devel mailing list