Using overlay to move a image from left to right feels very stuttery, as if it's moving every 0.5 second instead of per frame.
Complete:
ffmpeg -hide_banner -y -loop 1 -r 2 -i 'bg.png' -i 'centerpiece.png' -t 30 -c:v libx264 -filter_complex "[1:v]scale=iw*2.2:ih*2.2[scaled_cen],[0:v][scaled_cen]overlay=(main_w-overlay_w)/3+(t*10):(main_h-overlay_h)/2,format=pix_fmts=yuv420p" -r 30 output.mp4
The important part is this:
[scaled_cen]overlay=(main_w-overlay_w)/3+(t*10):(main_h-overlay_h)/2
According to the ffmpeg docs, t
is evaluated in seconds, but I've read elsewhere that its evaluated in MS, in any case I'd like my centerpiece to move a little bit every frame.
Here's the result of the command showing the choppyness:
https://i.imgur.com/PN4Ji1P.mp4
So far i've tried things like the blur filter and minterpolate but I'm guessing the problem resides in getting t
more granular or doing tricks with the fps.
===EDIT====
After applying the answer of Mulvya it still seemed a bit jittery, but adding:
tblend=average,framestep=2,setpts=0.25*PTS
at the end of the filter but before the format
filter seems to do the trick.