0

I'm trying to apply a smooth zoom effect to my 5-second video using FFmpeg, but I'm encountering a shaky/jittery zoom.

Here's the command I'm using:

ffmpeg -i island_zoom.mp4 -vf "zoompan=z='min(max(zoom,pzoom)+0.0015,1.5)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':s=1080x1920:fps=30" -preset ultrafast output_zoom.mp4

Input: island_zoom.mp4

Output: output_zoom.mp4

I am aware of the ffmpeg bug #4298. According to the comments, it's possible to upscale the resolution before applying the zoom, for example, using scale=8000x4000 before the zoompan filter. However, I'm trying to avoid this approach because I have a large number of videos to process, and adding this extra scaling step would significantly increase the processing time.

Can anyone suggest an effective workaround? Thanks for help!

1 Answer 1

0

pad to square 1920x1920, then zoom to divisible by 2 value:

ffmpeg -loop 1 -t 5 -r 30 -i img.jpg -vf "
format=yuv444p,
pad=1920:1920:-1:-1,
zoompan=z='trunc(iw*10*(1+0.0015*in)/2)*2/(iw*10)'
:d=1
:x='iw/2-iw/zoom/2'
:y='ih/2-ih/zoom/2'
:s=1920x1920
:fps=30,
crop=1080
" out.mp4

tested with jpg only

Your Answer

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

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