A command-line tool for applying the Ken Burns pan/zoom effect to still images, producing video output via ffmpeg.
- Smooth zoom + pan animation on any still image
- Handles landscape, portrait, and wide panoramic images automatically
- Crops to output aspect ratio without letterboxing or empty space
- Configurable focal point, pan direction, zoom level, duration, and resolution
- Random focal point and direction when not specified
go build -o kenner ../kenner -input <image> [options]| Flag | Default | Description |
|---|---|---|
-input |
(required) | Input image path |
-output |
<input>_kenburns.mp4 |
Output video path |
-duration |
10 |
Video length in seconds |
-fps |
25 |
Frames per second |
-width |
1920 |
Output width in pixels |
-height |
0 (auto 16:9) |
Output height in pixels |
-focal-x |
random | Focal point X coordinate |
-focal-y |
random | Focal point Y coordinate |
-direction |
random | Pan direction |
-zoom |
1.3 |
End zoom level (e.g. 1.3 = 30% zoom) |
-scale-up |
auto | Internal upscale factor |
north, south, east, west, northeast, northwest, southeast, southwest
./kenner -input photo.jpgProduces photo_kenburns.mp4 — a 10-second, 1920x1080 video with a random pan/zoom.
./kenner -input landscape.jpg -duration 15 -direction southeast15-second video panning southeast with a gradual 1.3x zoom.
./kenner -input portrait.jpg -direction north -zoom 1.5Automatically crops to 16:9, zooms to 1.5x while panning upward.
./kenner -input photo.jpg -focal-x 960 -focal-y 540 -width 1280 -height 720 -duration 8Zooms into the center of a 1920x1080 image, outputting 1280x720 at 8 seconds.
./kenner -input banner.png -direction east -width 1280 -zoom 1.4Crops the wide image to 16:9 and pans eastward.
- Detects input image dimensions via
ffprobe - Crops to the target output aspect ratio, centering on the focal point
- Scales up the cropped image to provide room for zooming
- Constructs an
ffmpegzoompan filter with computed expressions for smooth linear interpolation of zoom level and pan position - Encodes to H.264 MP4