title: FFmpeg zoom not smooth-centered (but zigzag)
body: <p>I try to perform a basic <a href="https://www.ffmpeg.org/ffmpeg-all.html#zoompan" rel="nofollow">zoompan</a> with <strong>FFmpeg</strong>. I have an input image (.png 1280x720) and i create an 8 seconds video (.mp4 320x180) from it, with a zoom. This is my command:</p>
  
  <blockquote>
    <p>ffmpeg -loop 1 -i in_img.png -c:v libx264 -pix_fmt yuv420p -strict experimental -framerate 25 <strong>-vf zoompan=z='min(zoom+0.011835363,2.1835363)':d=375:x=400:y=247</strong> -s 320x180 -t 00:00:08.882 out_vid.mp4</p>
  </blockquote>
  
  <p>Everything works...but the zoom is not looking okay. It is going zig-zag. </p>
  
  <p>Does anyone know how to make it zoom smooth, like centered? (And not first left then right)</p>
  
  <p>Thanks</p>
  
  <h2>EDIT</h2>
  
  <hr>
  
  <p>I've come a small step closer to a solution by slightly modifying the 'x' and 'y' in the -vf filter (rest of the command is the same as above):</p>
  
  <blockquote>
    <p>-vf
    zoompan=z='min(zoom+0.022,3.25)':d=375:x='if(gte(zoom,3.25),x,x+8.24)':y='if(gte(zoom,3.25),y,y+4.72)':s=1280x720 </p>
  </blockquote>
  
  <p>I incement <strong>x</strong> and <strong>y</strong> every frame <em>(for x +8.24, for y +4.72, i know those values because i know how many frames it takes get to the end-zoom state)</em> so that it will move to its end zoom state coordinate (1011,582), see image:</p>
  
  <p><img src="https://i.gyazo.com/0f9138b2e3ac34a28e2c928f56f76ce4.png" alt="Zoom Visualization">
  <a href="https://www.youtube.com/watch?v=aF-My9FDLD0" rel="nofollow">This is the video of the result</a>, as you can see it does not do the zig-zag effect, but now it looks like its going first to the center and then to the zoomed result. Or is that only an illusion??
  Any idea's?</p>