zoompan grows z from 1 to 1.12 over d=150 frames and turns one photo into a 5-second push-in at 30 fps; crop to 9:16 first or the picture comes out squeezed. ReelSDK's slideshow API adds Ken Burns motion for $0.03 per output minute.

Ken Burns effect with ffmpeg

zoompan snaps its window to whole pixels, so a slow pan steps between about 2 and 4 px a frame and shakes. ReelSDK's engine pans with the perspective filter instead, where steps vary by about a tenth of a pixel; a 4x upscale is the simpler fix.

GuidesUpdated

zoom in
ffmpeg -i oranges.jpg -vf "crop=608:1080:960:0,scale=2432:4320,zoompan=z='1+0.12*on/149':x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':d=150:s=1080x1920:fps=30,format=yuv420p" \
  -c:v libx264 -crf 20 -preset veryfast -movflags +faststart kenburns.mp4

Crop a 9:16 window from the 16:9 photo first, so the output is not squeezed, and scale it up 4x so the zoom has pixels to spare. z grows from 1 to 1.12 over d=150 frames; on is the output frame number. Result: a 5-second 1080x1920 clip.

Variations

The other commands you will need

  1. Pan across a wide photo

    Hold the zoom at 1.25 and move x from 0 to the right edge, (iw-iw/zoom), over 149 steps. The scale=7680:-2 in front is the jitter fix: without it the step between frames swung between about 2 and 4 px.

    pan
    ffmpeg -i plaza.jpg -vf "scale=7680:-2,zoompan=z=1.25:x='(iw-iw/zoom)*on/149':y='(ih-ih/zoom)/2':d=150:s=1920x1080:fps=30" \
      -c:v libx264 -crf 18 -preset veryfast pan.mp4
  2. Sub-pixel pan with perspective

    perspective maps four corners per frame and interpolates between pixels, so the motion has no steps at all: the shift per frame stayed within a tenth of a pixel. Loop the photo with -loop 1 and stop at 150 frames.

    perspective pan
    ffmpeg -loop 1 -framerate 30 -i plaza.jpg -vf "perspective=x0='(W-W/1.25)*in/149':y0='H*0.1':x1='(W-W/1.25)*in/149+W*0.8':y1='H*0.1':x2='(W-W/1.25)*in/149':y2='H*0.9':x3='(W-W/1.25)*in/149+W*0.8':y3='H*0.9':interpolation=linear:sense=source:eval=frame,format=yuv420p" \
      -frames:v 150 -c:v libx264 -crf 18 -preset veryfast pan-persp.mp4

The flags

The zoompan options and the filters around it

The zoompan options and the filters around it
FlagWhat it doesUsed here
z='1+0.12*on/149'Zoom per output frame, clipped to 1 to 10Zoom in
d=150Frames written per input image; the default is 90Both zoompan commands
s=1080x1920Output size; the default is hd720, and the window is scaled to it whatever its shapeZoom in
fps=30Output frame rate; the default is 25Both zoompan commands
x='iw/2-(iw/zoom/2)'Left edge of the window; this keeps it centredZoom in
scale=2432:43204x upscale before zoompan, for finer stepsZoom in, pan
perspectiveMoves the corners per frame with interpolation, no whole-pixel stepsPerspective pan
-loop 1 -framerate 30Repeats the photo as a 30 fps stream for filters that need one frame per output framePerspective pan

Sources: ffmpeg filters: zoompan, perspective, vf_zoompan.c in FFmpeg 8.1, checked November 2026.

Why zoompan shakes

In FFmpeg 8.1's source, zoompan keeps the window position and size as integers and rounds x and y down to the chroma grid, which is every other pixel for 4:2:0 photos. A slow move asks for fractions of a pixel per frame, so the window holds still, then jumps.

We panned the same 1920x1080 photo three ways and measured how far the picture moved from frame to frame. Plain zoompan should step about 3 px a frame, but its steps ranged over almost 2 px. Upscaling 4x first cut that spread to under a pixel; perspective, which interpolates, to a tenth of one.

Keep the shape right

zoompan scales its window to s without asking whether the shapes match. Feeding the 16:9 photo straight into s=1080x1920 gave a squeezed picture. Crop a 9:16 window first, as the zoom command does with crop=608:1080, and the picture keeps its proportions.

The upscale has a cost: the 4x pan took about 15 seconds, against 9 for the plain one, and perspective sat in between. On a 5-second clip that is still only seconds.

Many photos at once

For a set of photos, the slideshow API does this for you with motion: "kenburns". It uses perspective with linear interpolation, zooms each photo by an amount that grows with its length, and cycles through 8 moves: zooms in and out and pans in four directions.

For a single shot with your own expressions, send the args to the ffmpeg endpoint, billed per compute second; see pricing.

Without installing ffmpeg

The same command as one API call

Send the zoom command's args to POST /v1/ffmpeg with the photo's URL in inputs. Each job runs ffmpeg 8.1 on a fresh machine at $0.02 per compute minute, billed per second; this one finished in about 22 seconds and cost under three quarters of a cent.

terminalTry it
curl "https://api.reelsdk.com/v1/ffmpeg?wait=60" \
  -H "Authorization: Bearer $REELSDK_KEY" \
  --json '{
    "inputs": {
      "oranges.jpg": "https://api.reelsdk.com/f/lib/demo/seville/oranges.jpg"
    },
    "args": [
      "-i", "oranges.jpg", "-vf",
      "crop=608:1080:960:0,scale=2432:4320,zoompan=z='\''1+0.12*on/149'\'':x='\''iw/2-(iw/zoom/2)'\'':y='\''ih/2-(ih/zoom/2)'\'':d=150:s=1080x1920:fps=30,format=yuv420p",
      "-c:v", "libx264", "-crf", "20", "-preset", "veryfast", "-movflags",
      "+faststart", "kenburns.mp4"
    ],
    "outputs": ["kenburns.mp4"]
  }'
kenburns.mp4 from the API: a 5-second zoom at 1080x1920.Input: 1920x1080 photo

FAQ

Questions, answered

How do I make a Ken Burns zoom on a photo with ffmpeg?

Use zoompan with a zoom expression and a frame count, for example z='1+0.12*on/149':d=150:fps=30, which zooms from 1 to 1.12 over 5 seconds.

Why is my zoompan video shaky?

zoompan positions its window on whole pixels, rounded to even ones for 4:2:0 input, so slow moves step unevenly. Upscale the photo 4x before zoompan, or use the perspective filter, which interpolates.

Why does my picture look squashed?

zoompan scales its window to the s size you give it. Crop the photo to the output's shape first, for example crop=608:1080 for a 1080x1920 video from a 1920x1080 photo.

Can I do this for a whole slideshow without writing zoompan?

Yes. The slideshow API's motion: "kenburns" moves every photo with perspective and picks a different move for each one.

Ready to build?

Ship video from your app today

Your first $0.50 is free, and one key covers every endpoint.

Moonlit lake with a lit cabin under the mountains