>FFmpegLab
FFmpeg Guide

Ken Burns / Zoompan Effects – The Art of Motion

Bring still images to life with smooth pan-and-zoom animations. Master the zoompan filter to create Ken Burns effects, dynamic slideshows, and cinematic camera movements.

Add cinematic zoompan effects to your videos!.

Free in your browser — nothing to install, nothing uploaded.

Still images are beautiful—but motion brings them to life. The Ken Burns effect, named after the legendary documentary filmmaker, is a technique of slowly zooming in or out on a still image while panning across it. It adds a cinematic quality to slideshows, documentaries, and presentations.

FFmpeg's zoompan filter makes this effect possible—but its syntax is notoriously cryptic. The filter uses mathematical expressions for zoom level (z), pan position (x, y), duration (d), and output size (s). Getting the expressions right requires understanding how the filter works under the hood.

This guide demystifies zoompan, with clear examples, practical tips, and a visual approach that shows you exactly how to create stunning pan-and-zoom effects.

Key takeaways

The Gap: Cinematic Motion Without a Camera

The zoompan filter has been part of FFmpeg for years, but the documentation is minimal. The official description says: "Apply Zoom & Pan effect." That's it. The parameters are listed, but there's no guidance on how to use them.

Search online, and you'll find fragmented examples—some work, some don't. Most don't explain why the expressions are written the way they are. This guide fills that gap with clear explanations and practical, tested examples.

The Symptom: "My Slideshow Feels Static"

You've created a slideshow with FFmpeg. The images are beautiful, the transitions are smooth, and the music is perfect. But something feels off—it's static. Each image just sits there, frozen. You need motion, a sense of life, a cinematic quality.

That's exactly what the Ken Burns effect provides. And with zoompan, you can add it to every image in your slideshow.

Core Concepts: What Is the Ken Burns Effect?

The Ken Burns effect is a cinematic technique that slowly moves the camera across a still image. It typically involves:

The effect creates the illusion of camera movement, adding depth and storytelling to static images. It's used in documentaries, slideshows, and promotional videos.

The zoompan filter in FFmpeg generates a video by extracting a moving rectangular viewport from the input image, then scaling it to the output size.

Input Image Zoompan Animated Video
(Extracts a moving viewport and scales to output)

The zoompan Filter Syntax

The filter takes a string of parameters, each with an expression:

zoompan=z=EXPRESSION:x=EXPRESSION:y=EXPRESSION:d=DURATION:fps=FPS:s=WIDTHxHEIGHT

Parameters:

ParameterDescriptionDefault
zZoom factor (1.0 = no zoom, >1 = zoom in, <1 = zoom out)1.0
xX position of the viewport center (in input pixels)iw/2
yY position of the viewport center (in input pixels)ih/2
dNumber of frames to generateRequired
fpsOutput frame rate25
sOutput size (width x height in pixels)Input size

Important notes:

Understanding Expressions in zoompan

The expressions use a simple syntax similar to FFmpeg's evaluation engine. Here are the key variables:

Common expression patterns:

The formula for centering the viewport:

The viewport width at a given zoom is iw / zoom. To center the viewport, the offset from the left edge is:

x_offset = (iw - (iw / zoom)) / 2

So the center of the viewport is at iw/2 - (iw/zoom/2).

Example 1: Zoom In

Let's create a simple zoom-in effect on an image, from 1.0x to 1.5x over 5 seconds at 25 fps (125 frames).

ShareRenders { } Code Config
Generated Code Logs Customize
# Zoom in from 1.0x to 1.5x over 5 seconds
ffmpeg -i image.jpg -vf "zoompan=z='min(zoom+0.01,1.5)':d=125:s=1920x1080:fps=25" -c:v libx264 -crf 18 -t 5 zoom_in.mp4

Explanation:

The viewport is centered by default (x=iw/2, y=ih/2).

Example 2: Zoom Out

Zoom out from 1.2x down to 0.8x over 5 seconds.

ShareRenders { } Code Config
Generated Code Logs Customize
# Zoom out from 1.2x to 0.8x over 5 seconds
ffmpeg -i image.jpg -vf "zoompan=z='1.2 - 0.4*(t/125)':d=125:s=1920x1080:fps=25" -c:v libx264 -crf 18 -t 5 zoom_out.mp4

Here we use t directly: 1.2 - 0.4*(t/125) goes from 1.2 to 0.8 linearly over 125 frames.

Example 3: Pan Across

Pan from left to right while keeping zoom constant (1.0x).

ShareRenders { } Code Config
Generated Code Logs Customize
# Pan from left to right (constant zoom)
ffmpeg -i image.jpg -vf "zoompan=z=1:x='iw/2 + 100*t':d=125:s=1920x1080:fps=25" -c:v libx264 -crf 18 -t 5 pan.mp4

Explanation:

This creates a slow pan across the image. Adjust the multiplier (100) for faster/slower pan.

Example 4: Combined Zoom + Pan

Zoom in while panning to a specific area—a classic Ken Burns effect.

ShareRenders { } Code Config
Generated Code Logs Customize
# Ken Burns: zoom in on the right side of the image
ffmpeg -i image.jpg -vf "zoompan=z='min(zoom+0.01,1.8)':x='iw/2 - (iw/zoom/2) + 5*t':y='ih/2':d=125:s=1920x1080:fps=25" -c:v libx264 -crf 18 -t 5 kenburns_zoom_pan.mp4

This zooms in to 1.8x while panning to the right. The expression for x centers the viewport based on the current zoom, then adds a drift of 5 pixels per frame.

Example 5: Ken Burns Slideshow

Now let's apply Ken Burns to each image in a slideshow. We'll use the concat filter with trim and setpts to process each image independently.

ShareRenders { } Code Config
Generated Code Logs Customize
# Slideshow with Ken Burns on each image (3 images, 3 seconds each, with crossfades)
ffmpeg -loop 1 -i img1.jpg -loop 1 -i img2.jpg -loop 1 -i img3.jpg \
-filter_complex "[0:v]trim=0:3,setpts=PTS-STARTPTS,zoompan=z='min(zoom+0.02,1.5)':d=75:s=1920x1080:fps=25[v0]; \
[1:v]trim=0:3,setpts=PTS-STARTPTS,zoompan=z='max(zoom-0.02,0.8)':d=75:s=1920x1080:fps=25[v1]; \
[2:v]trim=0:3,setpts=PTS-STARTPTS,zoompan=z='min(zoom+0.015,1.4)':x='iw/2 - (iw/zoom/2) + 10*t':d=75:s=1920x1080:fps=25[v2]; \
[v0][v1]xfade=transition=fade:duration=1:offset=2[o1]; \
[o1][v2]xfade=transition=fade:duration=1:offset=5[out]" \
-map "[out]" -c:v libx264 -crf 18 -pix_fmt yuv420p slideshow_kenburns.mp4

Each image gets a different Ken Burns treatment: zoom in, zoom out, and zoom+pan. The xfade transitions create smooth crossfades between images.

Advanced: Custom Motion Paths

You can create complex motion paths by combining expressions. For example, a sinusoidal pan:

ShareRenders { } Code Config
Generated Code Logs Customize
# Sinusoidal pan + zoom (ken burns with wobble)
ffmpeg -i image.jpg -vf "zoompan=z='1+0.3*sin(t/20)':x='iw/2 - (iw/zoom/2) + 50*sin(t/15)':y='ih/2 - (ih/zoom/2) + 50*cos(t/20)':d=200:s=1920x1080:fps=25" -c:v libx264 -crf 18 -t 8 wobble.mp4

This creates a gentle oscillating pan with varying zoom, giving a dreamy, floating effect.

Troubleshooting Common Issues

Here are the most common issues with zoompan and how to fix them.

ProblemLikely CauseFix
Black borders appear Viewport moves beyond image bounds Clamp x and y: x='max(0, min(iw - iw/zoom, x_expr))'
Zoom doesn't change Expression uses zoom incorrectly Ensure you reference zoom variable properly, e.g., z='min(zoom+0.01,1.5)'
Output is still image d missing or set to 1 Set d to the number of frames desired
Stretched video Input aspect ratio differs from output size Set s=iw:ih to preserve aspect ratio, or use scale after
Zoom jumps at start Initial zoom value not set Set initial z in expression, e.g., z='1.0 + 0.5*(t/100)'
Motion is too fast Multipliers too large Reduce the increments (e.g., 0.005 instead of 0.01)

Ken Burns Made Easy with FFmpegLab

FFmpegLab's visual slideshow builder includes built‑in Ken Burns controls that eliminate the need to write complex expressions.

How FFmpegLab Simplifies Ken Burns

Here's how Ken Burns controls look in the FFmpegLab IDE:

ShareRenders { } Code Config
Generated Code Logs Customize
📸 Slide 1: Ken Burns active 🎯 Zoom: 1.0 → 1.5 🧭 Pan: Right (100px) ✅ Live preview
🖼️ Original
Start (zoom 1.0)
🎬 Ken Burns
● Zoom: 1.0 → 1.5 | Pan: Right
[kenburns]
Effect: zoom in + pan right
Start zoom: 1.0 | End zoom: 1.5
Pan offset: 100px
Duration: 3.0 seconds (75 frames)
# Generated by FFmpegLab Ken Burns Builder
# Drag sliders to adjust zoom and pan — preview in real time
🎬 Ken Burns active 🔍 Zoom: 1.0 → 1.5 ✅ Preview ready 💡 Drag to adjust pan

With FFmpegLab, you can create professional Ken Burns effects without writing a single line of code—but if you want to see what's happening under the hood, the generated FFmpeg command is always visible.

Frequently Asked Questions (FAQ)

What is the zoompan filter in FFmpeg?

The zoompan filter applies pan-and-zoom (Ken Burns) effects to a video stream. It allows you to zoom in or out on a specific area and pan across the image, creating smooth camera movement effects.

How do I create a zoom-in effect with zoompan?

Use the expression z='min(zoom+ZOOM_RATE, MAX_ZOOM)'. For example: zoompan=z='min(zoom+0.01,1.5)':d=125:s=1920x1080:fps=25. This zooms in from 1.0x to 1.5x over 5 seconds at 25 fps.

How do I create a pan effect with zoompan?

Use the x and y parameters with expressions. For example: x='iw/2 - (iw/zoom/2) + 5*t' moves the view center to the right while zooming. For a constant zoom pan, use z=1 and animate x or y.

How do I avoid black borders with zoompan?

Set the output size to match the input size (s=iw:ih or a fixed size) and use zoom expressions that don't cause the viewport to go beyond the image boundaries. You can clamp x and y to keep the viewport within bounds.

Can I use zoompan in a slideshow with transitions?

Yes. Apply zoompan to each image individually using trim and setpts, then concatenate with xfade transitions. FFmpegLab's visual slideshow builder makes this easy with built‑in Ken Burns controls.

What is the default frame rate for zoompan?

The default frame rate is 25 fps. You can change it with the fps parameter: fps=30 for 30 fps.

Final Word

The zoompan filter is one of FFmpeg's most powerful creative tools. With a few lines of expressions, you can transform static images into dynamic cinematic sequences.

Mastering zoompan requires understanding the relationship between zoom, pan, and the viewport. The key formulas are:

With practice, you can create smooth zoom-ins, zoom-outs, pans, and complex motion paths. And with FFmpegLab's visual controls, you can create Ken Burns effects without writing a single line of code—just drag sliders and preview in real time.

Next time you're creating a slideshow or video, bring your images to life with Ken Burns. Your audience will feel the motion.

Add cinematic zoompan effects to your videos!.

Free in your browser — nothing to install, nothing uploaded.

✦  Fresh from the render queue

Better FFmpeg workflows, delivered.

Get practical commands, new templates, and deep-dive guides for the edits that are usually hardest to get right.

✓  Copy-pasteable commands    ✓  Editor templates    ✓  No noise
One useful email at a time.