0

I have a background image that I'm trying to fade to specific color values using this filter: lutrgb=enable='gte(t,3)':'r=0.3*val:g=0.3*val:b=0.3*val'

This almost works, but it changes the values instantly. How do I get it to fade to those values gradually over time?

2
  • Your example doesn't alter alpha but the color channels. Is that what you want?
    – Gyan
    Commented Apr 14, 2017 at 15:48
  • Sorry, I was messing with alpha earlier and the word "opacity" stuck. I'm simply trying to get the background image to partially fade/darken, not become transparent.
    – HDL
    Commented Apr 14, 2017 at 16:01

1 Answer 1

2

The lut filter expressions don't work with time. geq does.

geq=r='(1-0.7*min((T-S)/D,1))*p(X,Y)':g={the same as r}:b={the same}:enable='gte(t,S)'

S should be your start time in second. D is duration for the change in colours. T and p(X,Y) are variables and should be kept as is.

7
  • Gives me an error. I tried both substituting each S with the start time and not substituting. [Parsed_geq_0 @ 0x7fa6ab5007c0] [Eval @ 0x7fff576460e0] Unknown function in 'S)/D,1))*p(X,Y)' [AVFilterGraph @ 0x7fa6ab413a80] Error initializing filter 'geq' with args 'r=(1-0.7*min((T-S)/D,1))*p(X,Y):g=(1-0.7*min((T-S)/D,1))*p(X,Y):b=(1-0.7*min((T-S)/D,1))*p(X,Y):enable=gte(t,3)'
    – HDL
    Commented Apr 14, 2017 at 16:58
  • S and D have to be substituted with numerical values.
    – Gyan
    Commented Apr 14, 2017 at 17:15
  • I got it working, however it's slowing the rest of the encoding process to a crawl. How do I get it to resume normal encoding speed?
    – HDL
    Commented Apr 14, 2017 at 17:46
  • Change enable to between(t,S,S+D) And add your lut filter for gte(t,S+D)
    – Gyan
    Commented Apr 14, 2017 at 17:50
  • I get an error trying that. Here's what I have: geq=r='(1-0.7*min((T-3)/3,1))*p(X,Y)':g='(1-0.7*min((T-3)/3,1))*p(X,Y)':b='(1-0.7*min((T-3)/3,1))*p(X,Y)':'between(t,3,3+3)',lutrgb=enable='gte(t,3+3)'
    – HDL
    Commented Apr 14, 2017 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.