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
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 :)
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 "overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0[out]" -map [out] -map 0:a? slide.mp4