FFMPEG – Smooth overlay of two video streams

Using FFMPEG, my goal is to create a video with a “smooth” parallax effect out of two large images.

I create two videos out of two PNG images (scroll animation).

ffmpeg -y -loop 1 -framerate 60 -i in1.png -vf "scroll=horizontal=0.00026,crop=1080:1920:0:500,format=yuv420p" -t 30 -c:v h264 out1.mp4

ffmpeg -y -loop 1 -framerate 60 -i in2.png -vf "scroll=horizontal=0.00022,crop=1080:1920:0:500,format=yuva420p" -t 30 -c:v png out2.mp4

My goal is to create a smooth parallax effect. This was my attempt:

ffmpeg -y -i out1.mp4 -vf "movie=out2.mp4 [mv]; [in][mv] overlay=0:0" out3.mp4

Problem: The animation of the overlay in out3.mp4 is not smooth at all.

Question: Is it possible to combine the first two ffmpeg commands to generate a smooth video output?

Read more here: Source link