Answers.Body: <p>The <code>lut</code> filter expressions don't work with time. <code>geq</code> does.</p>
  
  <pre><code>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)'
  </code></pre>
  
  <p><code>S</code> should be your start time in second. <code>D</code> is duration for the change in colours. <code>T</code> and <code>p(X,Y)</code> are variables and should be kept as is.  </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-14T16:58:39.047Z
Answers.Text: 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)'`
Answers.UserDisplayName: HDL
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-14T17:15:37.977Z
Answers.Text: `S` and `D` have to be substituted with numerical values.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-14T17:46:18.620Z
Answers.Text: 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?
Answers.UserDisplayName: HDL
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-14T17:50:28.323Z
Answers.Text: Change enable to `between(t,S,S+D) ` And add your lut filter for `gte(t,S+D)`
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-14T22:45:25.510Z
Answers.Text: 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)'`
Answers.UserDisplayName: HDL
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-15T05:02:06.510Z
Answers.Text: You have to keep the `enable=` before `between` (and I assume you've simply omitted the lut exprs for brevity. They should be specified)
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-15T19:35:38.343Z
Answers.Text: Finally got it. Thanks for your patience. I actually had to use `gt` instead of `gte`, otherwise I would get a frame of overlap where the image was extra darkened. Final command that works: `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)':enable='between(t,3,3+3)',lutrgb=enable='gt(t,6)':'r=0.3*val:g=0.3*val:b=0.3*val'`
Answers.UserDisplayName: HDL
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-14T16:28:03.750Z
Answers.LastActivityDate: 2017-04-14T16:28:03.750Z
Answers.UserDisplayName: Gyan
Body: <p>I have a background image that I'm trying to fade to specific color values using this filter: <code>lutrgb=enable='gte(t,3)':'r=0.3*val:g=0.3*val:b=0.3*val'</code></p>
  
  <p>This almost works, but it changes the values instantly.  How do I get it to fade to those values gradually over time?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-14T15:48:39.170Z
Comments.Text: Your example doesn't alter alpha but the color channels. Is that what you want?
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-14T16:01:13.870Z
Comments.Text: 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.
Comments.UserDisplayName: HDL
Tags: <video><ffmpeg><editing><filter><alpha>
Title: ffmpeg fade to specific color values over time
UserDisplayName: HDL
ThreadText: # ffmpeg fade to specific color values over time
  
  (Asked by: username_0 on 2017-04-14)
  
  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?
  
  **Tags:** video, ffmpeg, editing, filter, alpha
  
  > **Comments:**
  > **username_1**: Your example doesn't alter alpha but the color channels. Is that what you want?  
  > **username_0**: 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.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-04-14. Score: 2 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_0**: 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)'`  
  > **username_1**: `S` and `D` have to be substituted with numerical values.  
  > **username_0**: 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?  
  > **username_1**: Change enable to `between(t,S,S+D) ` And add your lut filter for `gte(t,S+D)`  
  > **username_0**: 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)'`  
  > **username_1**: You have to keep the `enable=` before `between` (and I assume you've simply omitted the lut exprs for brevity. They should be specified)  
  > **username_0**: Finally got it. Thanks for your patience. I actually had to use `gt` instead of `gte`, otherwise I would get a frame of overlap where the image was extra darkened. Final command that works: `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)':enable='between(t,3,3+3)',lutrgb=enable='gt(t,6)':'r=0.3*val:g=0.3*val:b=0.3*val'`  
  
  ---
  
  