<pre><code>x=tw-min(4*(tw\+10)-(abs(4-2*(t-1)))*(tw+10)-tw\,w/3.5)
</code></pre>
<p>With this script I can animate text from right to left and stay in middle for a second and then go back to right side.</p>

CC BY-SA 4.0
2020-10-08T05:59:34.780Z
2020-10-08T16:36:34.300Z
2020-10-08T16:36:34.300Z
zia Shahid
<pre><code>&quot;drawtext=fontfile=&quot;+fontPath+&quot;:text=&quot;+topText+&quot;:fontcolor=#FFFFFF:fontsize=40:box=0:boxcolor=black@0.2:boxborderw=5:x=min(4*(tw\\+10)-(abs(4-2*(t-1)))*(tw+10)-tw\\,w/3.5):y=main_h-(text_h*5)
</code></pre>
<p>With above script I am moving text from left to right and stay in middle and then move back to left.</p>
<p>How can I can animate it from right to left and then move back to right?</p>

<ffmpeg><ffmbc>
Change Text Animation Direction With FFMPEG
zia Shahid
# Change Text Animation Direction With FFMPEG

(Asked by: username_0 on 2020-10-07)

"drawtext=fontfile="+fontPath+":text="+topText+":fontcolor=#FFFFFF:fontsize=40:box=0:boxcolor=black@0.2:boxborderw=5:x=min(4*(tw\\+10)-(abs(4-2*(t-1)))*(tw+10)-tw\\,w/3.5):y=main_h-(text_h*5)

With above script I am moving text from left to right and stay in middle and then move back to left.
How can I can animate it from right to left and then move back to right?

**Tags:** ffmpeg, ffmbc


---

## 1 answers

### Answer by username_0 on 2020-10-08. Score: 1

x=tw-min(4*(tw\+10)-(abs(4-2*(t-1)))*(tw+10)-tw\,w/3.5)

With this script I can animate text from right to left and stay in middle for a second and then go back to right side.


---

