<p><a href="https://ffmpeg.org/ffmpeg-filters.html#overlay-1" rel="nofollow noreferrer">FFmpeg overlay</a> tells</p>
<ul>
<li><strong>x, y</strong>: Set the expression for the x and y coordinates of the overlaid
video on the main video. Default value is &quot;0&quot; for both expressions. In
case the expression is invalid, it is set to a huge value (meaning
that the overlay will not be displayed within the output visible
area).</li>
<li><strong>t</strong>: The timestamp, expressed in seconds. It’s NAN if the input timestamp is unknown.</li>
</ul>
<p>Scrolling means to update the x or y coordinate constantly, and the update formula should have the time variable.</p>
<p>There is an example from the page</p>
<blockquote>
<p>Make a sliding overlay appearing from the left to the right top part of the screen starting since time 2</p>
</blockquote>
<p>and the formula is</p>
<pre><code>overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
</code></pre>
<p>and the command would be</p>
<pre><code>ffmpeg -y -i logo_video.ts -i logo_image.png -filter_complex &quot;[0]overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0[out]&quot; -map [out] -map 0:a? slide.mp4
</code></pre>

CC BY-SA 4.0
2021-12-12T05:05:12.233Z
2021-12-12T05:05:12.233Z
xer-rex
<p>I believe what you're looking for is called tracking. If you have a video in which scrolling happens and need the image to stick on the video, meaning that it follows the scrolling, do the following:</p>

<ul>
<li>Open up After Effects and import both the image an the video.</li>
<li>Create a comp with the settings of the video and drag the video in it.</li>
<li>Create a Null-Object</li>
<li>On the right hand side, there's a panel called "tracking" or "tracker". Open it.</li>
<li>Select the Video since you want to track its movement and drag the tracking point (you only need one but can use however many you want) on a point of the video with high contrast, like edges or spots. (that makes it easier for the tracker to recognize the movement.)</li>
<li>Track the footage and check if the tracker sticks, correct it if you have to.</li>
<li>As the target, select the null-object and click apply. You need the y-axis at least, having both y and x doesn't hurt though.</li>
<li>Now, drag in the image and pick the whip (the little curly thing) and drop it on the null-object.</li>
</ul>

<p>If you did all of this, the image will follow the scrolling video. You might need to adjust the size and position of the image, but it will nonetheless follow your track.</p>

<p>Hope this helps, have a good one :)</p>

CC BY-SA 4.0
2019-08-24T18:25:54.457Z
OP tagged their question as ffmpeg, so they probably don't want to use After Effects.
MarianD
CC BY-SA 4.0
2019-07-25T10:25:20.123Z
2019-07-25T10:25:20.123Z
Florian Claaßen
<p>I need to overlay the image on video by scrolling the image on video .
I want to generate the video with the image in scrolling positions </p>

CC BY-SA 4.0
2019-07-23T06:10:16.357Z
It's a little hard to understand exactly what you're trying to achieve. Could you maybe rephrase your question? Describe exactly what you want to see.
stib
<video><ffmpeg>
Need overlay the image on video by taking the array of positions
Bharathi G
# Need overlay the image on video by taking the array of positions

(Asked by: username_0 on 2019-07-23)

I need to overlay the image on video by scrolling the image on video .
I want to generate the video with the image in scrolling positions

**Tags:** video, ffmpeg

> **Comments:**
> **username_1**: It's a little hard to understand exactly what you're trying to achieve. Could you maybe rephrase your question? Describe exactly what you want to see.  

---

## 2 answers

### Answer by username_2 on 2021-12-12. Score: 0

FFmpeg overlay tells

x, y: Set the expression for the x and y coordinates of the overlaid
video on the main video. Default value is "0" for both expressions. In
case the expression is invalid, it is set to a huge value (meaning
that the overlay will not be displayed within the output visible
area).
t: The timestamp, expressed in seconds. It’s NAN if the input timestamp is unknown.

Scrolling means to update the x or y coordinate constantly, and the update formula should have the time variable.
There is an example from the page

Make a sliding overlay appearing from the left to the right top part of the screen starting since time 2

and the formula is
overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0

and the command would be
ffmpeg -y -i logo_video.ts -i logo_image.png -filter_complex "[0]overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0[out]" -map [out] -map 0:a? slide.mp4


---

### Answer by username_3 on 2019-07-25. Score: 0

I believe what you're looking for is called tracking. If you have a video in which scrolling happens and need the image to stick on the video, meaning that it follows the scrolling, do the following:

* Open up After Effects and import both the image an the video.
* Create a comp with the settings of the video and drag the video in it.
* Create a Null-Object
* On the right hand side, there's a panel called "tracking" or "tracker". Open it.
* Select the Video since you want to track its movement and drag the tracking point (you only need one but can use however many you want) on a point of the video with high contrast, like edges or spots. (that makes it easier for the tracker to recognize the movement.)
* Track the footage and check if the tracker sticks, correct it if you have to.
* As the target, select the null-object and click apply. You need the y-axis at least, having both y and x doesn't hurt though.
* Now, drag in the image and pick the whip (the little curly thing) and drop it on the null-object.

If you did all of this, the image will follow the scrolling video. You might need to adjust the size and position of the image, but it will nonetheless follow your track.

Hope this helps, have a good one :)

> **Comments:**
> **username_4**: OP tagged their question as ffmpeg, so they probably don't want to use After Effects.  

---

