FFmpeg 4.1.11
Since* 3.2
#

The lut2 filter takes two input streams and outputs one stream.

The tlut2 (time lut2) filter takes two consecutive frames from one single stream.

This filter accepts the following parameters:

c0

set first pixel component expression

c1

set second pixel component expression

c2

set third pixel component expression

c3

set fourth pixel component expression, corresponds to the alpha component

Each of them specifies the expression to use for computing the lookup table for the corresponding pixel component values.

The exact component associated to each of the c* options depends on the format in inputs.

The expressions can contain the following constants:

w, h

The input width and height.

x

The first input value for the pixel component.

y

The second input value for the pixel component.

bdx

The first input video bit depth.

bdy

The second input video bit depth.

All expressions default to "x".

#

Examples

  • Highlight differences between two RGB video streams:

    lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1)'
  • Highlight differences between two YUV video streams:

    lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1)'
  • Show max difference between two video streams:

    lut2='if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1)))'