[FFmpeg-user] Using expressions in "FADE" filter

Moritz Barsnick barsnick at gmx.net
Thu Apr 30 09:50:49 CEST 2015

On Wed, Apr 29, 2015 at 17:57:43 -0400, Shlomo Morosow wrote:
> I need the ability to input mathematical values for setting the start time
> (st)  on the "fade" filter, I've attempted to use an expression and this
> particular filter does not seem to work with expressions, nor simple math
> as "10*1".

As far as I can tell, you are right in saying that this filter (or at
least the "st" argument) does not support expressions.

For "st", it also doesn't make much sense. Expressions are used not for
convenient calculation, but rather for expressing something which
changes over the course of a media stream, i.e. depending on frame
count, timestamp or the likes. "st" can only ever express a constant

If you need to do math, you can let your interpreter (on Unix: the
shell) do the math for you. I'm not sure how to do this on Windows (and
usually avoid it, even professionally). ;-)

> ffmpeg.exe -y -ss "0:00:20" -t "0:00:10" -i input.avi -filter_complex
> "fade=out:st=%{expr\\\: (10-1)}:d=1" -f dvd -target ntsc-dvd -r 29.97
> -aspect 4:3 -b:v 4500k -mbd rd -trellis 1 -flags +mv0 -cmp 0 -subcmp 2 -b:a
> 128k output.vob

Where is it documented that an expression is expressed as such?


More information about the ffmpeg-user mailing list