[FFmpeg-devel] [PATCH 4/4] ffmpeg: add -amerge option to merge audio streams.

Clément Bœsch ubitux at gmail.com
Mon Mar 26 17:36:47 CEST 2012


On Sat, Mar 24, 2012 at 02:24:59PM +0100, Stefano Sabatini wrote:
[...]
> > +            continue;
> > +        av_bprintf(&lavfi, "\namovie=%s:si=%d [a%d];", ifname, map->stream_index, nb_astreams++);
> 
> I see this is quite limited. Suppose that the user wants to specify a
> seek point or time, or in general codec/format options for the input
> file, this won't be possible. We can surely add such options to movie,
> but in general mapping ffmpeg options to *movie options will be a
> problem, and very hard to maintain, since they use rather different
> logics.
> 

Yup indeed, it's quite a hack. But integrating this feature properly means
changing quite a bunch of things. The only proper way I see right now is:

 1) ffmpeg using libavfilter for audio which depends on:
    * proper libavfilter audio API (AVFrame based API)
    * filter auto reconfiguration in case of sampling rate change
    * audio stretching in libavfilter (-async)
    * -af option (with auto insert of pan for map channel, and various
      others)
 2) create in the -amerge scope a merge context filtergraph just like the
    one used for -af, and reference the different input streams in the
    output stream context.
 3) make ffmpeg handle multiple input streams for a given output stream

This requires a tremendous amount of work before we can hope for this
feature.

Of course the current solution is far from ideal; just like you said, we
can't configure the input properly, and it will basically be limited to
standard usages. Though, it has the advantage to cover a majority of use
cases. Also, the hack is quite isolated (it doesn't affect the internals).

Do you or anyone else has an alternative to propose?

-- 
Clément B.
-------------- 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/20120326/7a530885/attachment.asc>


More information about the ffmpeg-devel mailing list