am using latest version of ffmpeg and i have added image overlay to video and am trying to animate the image overlay on video , its working ok but the overlay movement is not smooth its shaky/glitchy , so any idea how to make the animation smooth
ffmpeg.exe -y -i small.mp4 -loop 1 -i google.png -filter_complex [1]fade=t=in:st=1:d=1,fade=t=out:st=4.6:d=1[over1];[0:v][over1]overlay=x=20+((t-1)*85):shortest=1:y=66+((t-1)*23.04):enable='between(t,1,5.6)' -c:v libx264 output.mp4
input video : http://techslides.com/demos/sample-videos/small.mp4
image : https://i.stack.imgur.com/mrdnt.png
output video : https://vimeo.com/286859270
Update : Overlay Factor explanation
x=20+((t-1)*85):shortest=1:y=66+((t-1)*23.04)
85 ? 23.04 ?
85 and 23.04 is x and y shift rate through which i have to reach to destination x_end and y_end from x_start and y_start
x_start = 20 , y_start = 66
x_end = 411 , y_end = 172
x_diff = 391 y_diff = 106
overlay_start_time = 1 overlay_end_time = 5.6
duration = overlay_end_time - overlay_start_time
duration = 5.6 - 1
duration = 4.6
shift_x_rate = x_diff / duration
shift_x_rate = 391 / 4.6 = 85
shift_y_rate = y_diff / duration
shift_y_rate = 106 / 4.6 = 23.04
x = x_start + (t-overlay_start_time)* shift_x_rate
x = 20 + (t-1) * 85
let if t = 5.6
x = 20 + (5.6-1) * 85
x = 411 // destination x
y = y_start + (t-overlay_start_time)* shift_y_rate
y = 66 + (t-1) * 23.04
let if t = 5.6
y = 66 + (5.6-1) * 23.04
y = 171 // destination y