[FFmpeg-devel] [PATCH] lavfi: add fade filter

Stefano Sabatini stefano.sabatini-lala
Tue Mar 8 11:39:01 CET 2011

On date Tuesday 2011-02-22 04:53:13 +0100, Michael Niedermayer encoded:
> On Mon, Feb 21, 2011 at 10:22:00PM +0100, Stefano Sabatini wrote:
> > On date Monday 2011-02-21 18:06:50 +0100, Michael Niedermayer encoded:
> > > fade=in:10:20,fade=out:50:60
> > > could be supported as:
> > > fade=in:10:20:50:60
> > > 
> > > and
> > > fade=out:10:20:50:60
> > > to black a part out (currently not supported with individual filters easily)
> > > 
> > > and more than 2, that is N such fade in/outs in a single filter would also be
> > > usefull
> > > for example consider that someone concatenates videos from several scenes to
> > > make a movie. She might want to create fade out+fade in at the transitions
> > 
> > Uhm, so it may support a list:
> > fade=out=S:D;in=S:D;out=S:D;...
> fade=out=S:D:S:D:S:D:...
> doesnt need escaping and is shorter
> you cant have 2 out or 2 in after each other so this is not ambigous syntax

What about having two distinct fade and multifade filters?

My problem with the multifade is that allowing #F and time format
creates problems since it isn't possible to reliably predict the exact
timing of a duration expressed using a number of frames, so you could
have fade-in/fade-out intervals overlap or nesting.

On the other hand I reckon that using frames for expressing init and
end of a fade-in/out could be useful, and is not problematic for a
single fade.

So we could have:


(S=Start, D=Duration, E=End)

where S, D, and E can be expressed both as a number of frame (#F, with
F a number of frames) or TIME (where time is parsed by

For the multi-fade:

but with TIMEINT not supporting the #F syntax.

The following in|out are optional, but may help redability:
rather than:

Another possibility would be to drop the #F syntax, and have just one
fade filter.
FFmpeg = Fiendish and Frenzy Magical Purposeless Elected Gnome

More information about the ffmpeg-devel mailing list