Body: <p>Here is a new question on drawtext; actually, my drawtexts move from the left to right and from right to left, depending on the order ( 1,3,5... from left, 2,4,6 from right).</p>
  
  <p>Each drawtext has a box; it would be nice to have each drawtext disappear with a fade out before other drawtext come in.</p>
  
  <p>I see that there is the "fontcolor_exr", but I don't want to change the color of my text, I'd like to change the alpha, so I suppose I have to play with "alpha" props.
  Unfortunatly, I cannot figure out how to set an expression to add the alpha trasparency after x seconds to my drawtext. Any Idea?</p>
  
  <p>I'm trying to use something like this:</p>
  
  <pre><code>alpha='if(gt(t,4),--- some expresson --- ,1)'"
  </code></pre>
  
  <p>so that after 4 seconds, the drawtext will disappear. </p>
  
  <p>Thanks</p>
  
  <p><strong>SOLVED</strong></p>
  
  <p>I found this graceful solution; let the drawtext be enabled between 0 and 6 seconds; this command will fade out the text after 5 seconds:</p>
  
  <p>alpha='if(lt(t,5)\,1\,if(lt(t\,6)\,(1-(t-5))/1\,0))'</p>
  
  <p>The entire drawbox disappear at second 6. Hope it helps.</p>
  
  <p>See you next time!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-02-23T14:05:35.547Z
Comments.Text: You have to use fontcolor_expr. See 2nd last [example](https://ffmpeg.org/ffmpeg-all.html#Examples-89).
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-02-24T05:56:20.573Z
Comments.Text: I read that expression , `fontcolor_expr=ff0000...` but I really don't understand  what does it do, and cause I don't understand it, I cannot apply it  :( ... can you explain me quickly? tks!
Comments.UserDisplayName: GFCoder977
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-02-24T06:08:21.183Z
Comments.Text: and, sorry,  are you sure that ALL drawtext ( with box and border ) will disappear? I read that it is used to change the confcolor dinamically, while I need to fade the entire drawtext ( text, box, etc ... )  ..
Comments.UserDisplayName: GFCoder977
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-02-24T06:14:51.167Z
Comments.Text: No, the box, shadow.. won't disappear.
Comments.UserDisplayName: Gyan
Tags: <ffmpeg>
Title: ffmpeg - Drawtext Fade Out
UserDisplayName: GFCoder977
ThreadText: # ffmpeg - Drawtext Fade Out
  
  (Asked by: username_0 on 2018-02-23)
  
  Here is a new question on drawtext; actually, my drawtexts move from the left to right and from right to left, depending on the order ( 1,3,5... from left, 2,4,6 from right).
  
  Each drawtext has a box; it would be nice to have each drawtext disappear with a fade out before other drawtext come in.
  
  I see that there is the "fontcolor\_exr", but I don't want to change the color of my text, I'd like to change the alpha, so I suppose I have to play with "alpha" props.
  Unfortunatly, I cannot figure out how to set an expression to add the alpha trasparency after x seconds to my drawtext. Any Idea?
  
  I'm trying to use something like this:
  
  ```
  alpha='if(gt(t,4),--- some expresson --- ,1)'"
  
  ```
  
  so that after 4 seconds, the drawtext will disappear.
  
  Thanks
  
  **SOLVED**
  
  I found this graceful solution; let the drawtext be enabled between 0 and 6 seconds; this command will fade out the text after 5 seconds:
  
  alpha='if(lt(t,5)\,1\,if(lt(t\,6)\,(1-(t-5))/1\,0))'
  
  The entire drawbox disappear at second 6. Hope it helps.
  
  See you next time!
  
  **Tags:** ffmpeg
  
  > **Comments:**
  > **username_1**: You have to use fontcolor_expr. See 2nd last [example](https://ffmpeg.org/ffmpeg-all.html#Examples-89).  
  > **username_0**: I read that expression , `fontcolor_expr=ff0000...` but I really don't understand  what does it do, and cause I don't understand it, I cannot apply it  :( ... can you explain me quickly? tks!  
  > **username_0**: and, sorry,  are you sure that ALL drawtext ( with box and border ) will disappear? I read that it is used to change the confcolor dinamically, while I need to fade the entire drawtext ( text, box, etc ... )  ..  
  > **username_1**: No, the box, shadow.. won't disappear.  
  
  ---
  
  ## 0 answers
  
  