Skip to main content
replaced http://superuser.com/ with https://superuser.com/
Source Link

I was having the same issue and got an answer that worked really wellgot an answer that worked really well. The key is to first upscale the image prior to applying the zoom filter. You can downscale afterwards to the desired resolution.

The following scales up 10x, zooms to center, and then downscales back to 720p (the -2 x value in the scale filters maintains the aspect ratio, ie. scale=-2:10*ih). This pretty much eliminates the jiggle:

ffmpeg -r 25 -i LVjYi.jpg -filter_complex "scale=-2:10*ih,zoompan=z='min(zoom+0.0015,1.5)':d=125:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)',scale=-2:720"  -y -shortest -c:v libx264 image_output.mp4

Note that it seems the higher the initial upscale, the smoother the resulting zoom. Compare the above to an upscale of only 2x:

ffmpeg -r 25 -i LVjYi.jpg -filter_complex "scale=-2:2*ih,zoompan=z='min(zoom+0.0015,1.5)':d=125:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)',scale=-2:720"  -y -shortest -c:v libx264 image_output.mp4

That one is still jiggly.

I was having the same issue and got an answer that worked really well. The key is to first upscale the image prior to applying the zoom filter. You can downscale afterwards to the desired resolution.

The following scales up 10x, zooms to center, and then downscales back to 720p (the -2 x value in the scale filters maintains the aspect ratio, ie. scale=-2:10*ih). This pretty much eliminates the jiggle:

ffmpeg -r 25 -i LVjYi.jpg -filter_complex "scale=-2:10*ih,zoompan=z='min(zoom+0.0015,1.5)':d=125:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)',scale=-2:720"  -y -shortest -c:v libx264 image_output.mp4

Note that it seems the higher the initial upscale, the smoother the resulting zoom. Compare the above to an upscale of only 2x:

ffmpeg -r 25 -i LVjYi.jpg -filter_complex "scale=-2:2*ih,zoompan=z='min(zoom+0.0015,1.5)':d=125:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)',scale=-2:720"  -y -shortest -c:v libx264 image_output.mp4

That one is still jiggly.

I was having the same issue and got an answer that worked really well. The key is to first upscale the image prior to applying the zoom filter. You can downscale afterwards to the desired resolution.

The following scales up 10x, zooms to center, and then downscales back to 720p (the -2 x value in the scale filters maintains the aspect ratio, ie. scale=-2:10*ih). This pretty much eliminates the jiggle:

ffmpeg -r 25 -i LVjYi.jpg -filter_complex "scale=-2:10*ih,zoompan=z='min(zoom+0.0015,1.5)':d=125:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)',scale=-2:720"  -y -shortest -c:v libx264 image_output.mp4

Note that it seems the higher the initial upscale, the smoother the resulting zoom. Compare the above to an upscale of only 2x:

ffmpeg -r 25 -i LVjYi.jpg -filter_complex "scale=-2:2*ih,zoompan=z='min(zoom+0.0015,1.5)':d=125:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)',scale=-2:720"  -y -shortest -c:v libx264 image_output.mp4

That one is still jiggly.

Source Link
Timbo White
  • 255
  • 1
  • 2
  • 9

I was having the same issue and got an answer that worked really well. The key is to first upscale the image prior to applying the zoom filter. You can downscale afterwards to the desired resolution.

The following scales up 10x, zooms to center, and then downscales back to 720p (the -2 x value in the scale filters maintains the aspect ratio, ie. scale=-2:10*ih). This pretty much eliminates the jiggle:

ffmpeg -r 25 -i LVjYi.jpg -filter_complex "scale=-2:10*ih,zoompan=z='min(zoom+0.0015,1.5)':d=125:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)',scale=-2:720"  -y -shortest -c:v libx264 image_output.mp4

Note that it seems the higher the initial upscale, the smoother the resulting zoom. Compare the above to an upscale of only 2x:

ffmpeg -r 25 -i LVjYi.jpg -filter_complex "scale=-2:2*ih,zoompan=z='min(zoom+0.0015,1.5)':d=125:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)',scale=-2:720"  -y -shortest -c:v libx264 image_output.mp4

That one is still jiggly.