[FFmpeg-devel] [PATCH] lavfi/asplit: move asplit code to vf_split.c, and make it supports N outputs

Stefano Sabatini stefasab at gmail.com
Sat May 19 13:29:34 CEST 2012


On date Saturday 2012-05-19 01:12:06 +0200, Clément Bœsch encoded:
> On Sat, May 19, 2012 at 12:50:05AM +0200, Stefano Sabatini wrote:
> > The move allows to share the init code already used by split.
> > ---
> >  doc/filters.texi        |   16 +++++++++----
> >  libavfilter/Makefile    |    2 +-
> >  libavfilter/af_asplit.c |   56 -----------------------------------------------
> >  libavfilter/vf_split.c  |   32 ++++++++++++++++++++++++++-
> >  4 files changed, 43 insertions(+), 63 deletions(-)
> >  delete mode 100644 libavfilter/af_asplit.c
> > 
> > diff --git a/doc/filters.texi b/doc/filters.texi
> > index 06374fc..467fb4a 100644
> > --- a/doc/filters.texi
> > +++ b/doc/filters.texi
> > @@ -304,16 +304,22 @@ expressed in the form "[@var{c0} @var{c1} @var{c2} @var{c3} @var{c4} @var{c5}
> >  
> >  @section asplit
> >  
> > -Pass on the input audio to two outputs. Both outputs are identical to
> > -the input audio.
> > +Pass on the input audio to N outputs. Both outputs are identical to
> > +the input audio. The number of outputs is specified as argument to the
> > +filter, default value is 2.
> >  
> >  For example:
> >  @example
> > -[in] asplit[out0], showaudio[out1]
> > +[in] asplit[out0][out1]
> 
> nit: maybe some consistent spacing? "[in] asplit [out0][out1]" (or no
> space at all).
> 
> >  @end example
> >  
> > -will create two separate outputs from the same input, one cropped and
> > -one padded.
> > +will create two separate outputs from the same input.
> > +
> > +To create 3 or more outputs, you need to specify the number of
> > +outputs, like in:
> > + at example
> > +[in] asplit=3[out0][out1][out2]
> 
> ditto

fixed

[...]
> > +AVFilter avfilter_af_asplit = {
> > +    .name      = "asplit",
> > +    .description = NULL_IF_CONFIG_SMALL("Pass on the audio input to N audio outputs."),
> > +
> > +    .init   = split_init,
> > +    .uninit = split_uninit,
> > +
> > +    .inputs = (const AVFilterPad[]) {
> > +        {
> > +            .name             = "default",
> > +            .type             = AVMEDIA_TYPE_AUDIO,
> > +            .get_audio_buffer = ff_null_get_audio_buffer,
> > +            .filter_samples   = filter_samples,
> > +        },
> > +        { .name = NULL }
> > +    },
> > +    .outputs = (const AVFilterPad[]) {{ .name = NULL }},
> > +};
> 
> I may be dreaming, but isn't it possible to use the "split" filter as
> audio or video depending on the input by adding an audio input in
> avfilter_vf_split.inputs?

How so?

Patch pushed.
-- 
FFmpeg = Faithless and Fancy Minimalistic Powerful Earthshaking Gladiator


More information about the ffmpeg-devel mailing list