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
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.mp4Crop 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
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. Thescale=7680:-2in 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.mp4Sub-pixel pan with perspective
perspectivemaps 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 1and 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
| Flag | What it does | Used here |
|---|---|---|
z='1+0.12*on/149' | Zoom per output frame, clipped to 1 to 10 | Zoom in |
d=150 | Frames written per input image; the default is 90 | Both zoompan commands |
s=1080x1920 | Output size; the default is hd720, and the window is scaled to it whatever its shape | Zoom in |
fps=30 | Output frame rate; the default is 25 | Both zoompan commands |
x='iw/2-(iw/zoom/2)' | Left edge of the window; this keeps it centred | Zoom in |
scale=2432:4320 | 4x upscale before zoompan, for finer steps | Zoom in, pan |
perspective | Moves the corners per frame with interpolation, no whole-pixel steps | Perspective pan |
-loop 1 -framerate 30 | Repeats the photo as a 30 fps stream for filters that need one frame per output frame | Perspective 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.
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"]
}'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.
- TikTok slideshow APITurn photos into a vertical TikTok-style slideshow with music and transitions, named or random, in one POST.
- Narrated slideshow APISend images and a script; get back a video narrated in one of 40 voices, with captions and music under the voice.
- Images to video with ffmpegTurn photos into an MP4 slideshow with music: frame rate per photo, a concat list for custom durations, and one still with audio.
- ffmpeg xfade transitions, all 59 renderedEvery xfade transition in ffmpeg 8.1 as a clip you can play, with the offset math and the fix for the do-not-match error.
- Blurred background video with ffmpegFit a 16:9 clip into a 9:16 frame over a blurred copy of itself: scale, crop, gblur and overlay in one filter graph.
- Photo slideshow makerTurn up to 10 photos into a video with transitions and free music for TikTok, Reels or Shorts: free right here, or one POST /v1/slideshow call.
- Product videos from photosTurn ecommerce product photos into a short video with slide transitions and music, in any feed shape, with one POST.
- Real estate listing videosTurn landscape listing photos into a vertical reel with a voiceover, music and captions, without cropping a single photo.
- ReelSDK vs self-hosted FFmpegTranscoding a minute of 1080p to 720p takes about 24 seconds of compute: about 0.8 cents on ReelSDK, about a tenth of a cent on a busy 4 vCPU box. Below about 11,000 minutes a month, the API costs less than an always-on box.
Sources, checked November 2026
Ready to build?
Ship video from your app today
Your first $0.50 is free, and one key covers every endpoint.
