A slideshow shows photos one after another. A timelapse plays a long recording fast. For both, you set two things separately: how often an image or frame is taken from the input, and how fast the output plays. Every example writes a new file and leaves the original as it is.
Sequential PNG → Video (Slideshow)
Make a video from numbered images such as img001.png, img002.png.
ffmpeg -framerate 1 -i img%03d.png -c:v libx264 -pix_fmt yuv420p output.mp4
Put the numbered images in the folder where you run the command. Check that no number is missing and that all files have the same extension.
-framerate 1— reads the input at 1fps, so each image stays on screen for 1 second-i img%03d.png— readsimg001.png,img002.png, … in order%03dis a 3-digit number padded with zeros (use%04dfor 4 digits)
25fps output:
To keep each image on screen for one second but output 25fps, leave -framerate 1 on the input and add -r 25 for the output.
ffmpeg -framerate 1 -i img%03d.png -c:v libx264 -pix_fmt yuv420p -r 25 output.mp4
FFmpeg repeats each image to fill 25fps. It does not create motion between photos or add a fade between them.
Single Image → Short Video (Loop)
To turn one image into a video of a set length, combine -loop 1 with -t.
ffmpeg -loop 1 -i image.png -t 5 -c:v libx264 -pix_fmt yuv420p output.mp4
-loop 1— keeps reading the same image over and over-t 5— stops the output at 5 seconds- Replace
image.pngwith the name of your image file
The Importance of pix_fmt yuv420p
The pixel format (the way color is stored) that libx264 writes depends on the input and the settings. PNG images are RGB, so without -pix_fmt yuv420p the video comes out as yuv444p (H.264 High 4:4:4), which many players cannot play. H.264 output does not keep the transparency (alpha) of an RGBA image.
If the video must play on most players, add -pix_fmt yuv420p:
ffmpeg -loop 1 -i image.png -t 3 -c:v libx264 -pix_fmt yuv420p output.mp4
yuv420p is an 8-bit, 4:2:0 pixel format. It is a different setting from the color space. It stores less color detail, so fine edges between colors can change slightly. Keep the width and height even, and play the result on the player you plan to use.
Timelapse (Frame Dropping from Video)
Dropping frames with the fps filter alone does not make the video shorter. You need to set two things: how often to take a frame, and when each kept frame plays. The examples remove the audio, because the original sound would no longer match the faster video.
About 10x speed, played at 30 frames per second:
ffmpeg -i input.mp4 -vf "fps=3,settb=AVTB,setpts=N/(30*TB),fps=30" -an -c:v libx264 -pix_fmt yuv420p timelapse-10x.mp4
This takes three frames from each second of input and plays them at 30 frames per second. settb=AVTB switches to a finer time unit so setpts can set the new play times exactly, and the final fps=30 evens out the frame spacing. Depending on the input length and frame count, the output length may not come out as a round number.
| Sampling interval | Speed when the sampled sequence plays at 30 fps |
|---|---|
| 3 frames each second | About 10x |
| 1 frame each second | About 30x |
| 1 frame every 10 seconds | About 300x |
To take one frame every ten seconds, use the next command. A one-hour input gives about 12 seconds of output.
ffmpeg -i input.mp4 -vf "fps=1/10,settb=AVTB,setpts=N/(30*TB),fps=30" -an -c:v libx264 -pix_fmt yuv420p timelapse-300x.mp4
Keep the original, and play the result to check its length, motion and orientation.
The table shows the output lengths for a 20-second, 320x180, 30fps synthetic test pattern with no audio. Each case was run once with FFmpeg 8.1 on Windows on September 11, 2026. The control row uses frame dropping alone, without new timestamps.
| Operation | Measured output duration |
|---|---|
Control: fps=1/10 alone, audio removed |
20.000000 seconds |
| 10x example above | 2.000000 seconds |
| 300x example above | 0.066667 seconds |
The measurement record lists the commands, including the control, and how the test input was made.
Taking one frame every ten seconds from a short input leaves only a few frames. Pick a speed that suits the length of your footage.
Sequential JPG → Video (From Timelapse Source Material)
To make a video from numbered JPEGs shot with a camera’s interval timer:
ffmpeg -framerate 24 -i photo%04d.jpg -c:v libx264 -pix_fmt yuv420p output.mp4
%04d matches 4-digit numbers padded with zeros, such as photo0001.jpg, photo0002.jpg, …
To start from another number (for example photo0100.jpg):
ffmpeg -framerate 24 -start_number 100 -i photo%04d.jpg -c:v libx264 -pix_fmt yuv420p output.mp4
Frame Rate Summary
| Purpose | Recommended setting |
|---|---|
| Slideshow at 1 second per image | -framerate 1 |
| One second per image, 25fps output | Input -framerate 1, output -r 25 |
| Normal video | -framerate 24 or 30 |
| Timelapse (about 10x speed) | The fps=3 example above, with new timestamps |
About the image2 Demuxer
FFmpeg reads numbered images with its image2 demuxer (the part that reads this kind of input). It is usually chosen automatically, but you can also name it:
ffmpeg -f image2 -framerate 25 -i img%03d.png -c:v libx264 -pix_fmt yuv420p output.mp4
You rarely need -f image2. Add it when FFmpeg does not recognize the files as an image sequence.
Related articles:
Frequently Asked Questions
How do I make a slideshow from a folder of images?
Give the images numbered names, then change the input in the first example to -framerate 1/3 -i img%03d.png. Each image then stays on screen for three seconds. -pattern_type glob does not work in every build, so numbered names are easier, especially on Windows.
How do I add a Ken Burns zoom?
zoompan=z='min(zoom+0.0015,1.5)':d=125:s=1280x720 zooms into each image over about 5 seconds. Add xfade to crossfade between slides.
Why is my timelapse choppy?
With a long gap between shots, moving things jump from place to place. If you can reshoot, try a shorter interval. tmix=frames=3 blends neighboring frames. It cannot bring back motion that was never captured, and it can leave ghost images.
Slideshow audio cuts off — how to match audio to image count?
First work out the video length: the number of images times the seconds per image. -shortest ends the output when the shorter stream ends; it cannot make short audio longer. Decide whether to loop the audio or fill the gap with silence, then set the total length.
Can I mix portrait and landscape photos?
pad only adds borders, so it cannot shrink an image that is too big. First fit each image into the same frame size, for example with scale=1920:1080:force_original_aspect_ratio=decrease:force_divisible_by=2,pad=1920:1080:(ow-iw)/2:(oh-ih)/2:black,setsar=1. When images in a sequence change size, FFmpeg rebuilds (reinitializes) its filters. Making all images the same size first avoids surprises from that.