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.


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:


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:


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.


After applying the answer of Mulvya it still seemed a bit jittery, but adding:


at the end of the filter but before the format filter seems to do the trick.

1 Answer 1


The overlay filter draws on each base or 'main' frame as given; it does not create new frames.

In your command,

ffmpeg -hide_banner -y -loop 1 -r 2 -i 'bg.png' ...

The -r 2 sets the main video's framerate to 2, hence the result.


ffmpeg -hide_banner -y -loop 1 -framerate 30 -i 'bg.png' ...
  • Yep, that's it! I remember adding -r 30 in front of the command but I completely missed that I also had the -r 2 in there, so it just got overridden. Thanks!
    – Rohan
    Jan 10, 2018 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.