[FFmpeg-user] xfade filter - custom expressions

Edward Park kumowoon1025 at gmail.com
Wed Sep 23 22:48:44 EEST 2020


Hi,

> "XY - The coordinates of the current sample." - Is the transition defined
> by selecting a color/state for each pixel?
> 
> "WH - The width and height of the image." - OK.
> 
> "P - Progress of transition effect." - Looking at the source, this is a
> float. Ranging from 0-1 I assume(?)
> 
> "PLANE - Currently processed plane." - Not sure what this means. How many
> planes are there? I'd say at least 2, one for each input. Are there more?
> 
> "A - Return value of first input at current location and plane." - This
> would return something like first_input[x][y] if the input were treated as
> an array? But I still don't understand what the plane refers to OR what the
> value returned would be. Would it be 0 or 1, or some color value?
> 
> "a0(x, y) a1(x, y) a2(x, y) a3(x, y) - Return the value of the pixel at
> location (x,y) of the first/second/third/fourth component of first input."
> - What does 'component' refer to? 1234 == RGBA ?
> 
> Is there an example that illustrates how to use a custom expression to
> achieve a meaningful transition?

I’m not sure how to write equations for separate components on the command line either, but using your interpretation as reference, tried out expr='A*P+B*(1-P)’ and got a basic working fade, at least looking at it visually with a couple sources.

Regards,
Ted Park



More information about the ffmpeg-user mailing list