Name the photos img01.jpg to img05.jpg and read them at -framerate 1/3: each stays 3 seconds, so five photos and a song make 15 seconds of vertical video. ReelSDK's slideshow API adds transitions for $0.03 per output minute.

Images to video with ffmpeg

Three numbers make a slideshow: seconds per photo, output frame rate and where the music ends, and 3 s, 30 fps and a 2-second fade work well. ReelSDK ran this one as raw ffmpeg in about 20 seconds, under three quarters of a cent.

GuidesUpdated

slideshow
ffmpeg -framerate 1/3 -i img%02d.jpg -i music.mp3 \
  -vf scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,format=yuv420p -r 30 \
  -c:v libx264 -crf 20 -preset veryfast \
  -af afade=t=out:st=13:d=2 -c:a aac -shortest -movflags +faststart slides.mp4

-framerate 1/3 reads one image every 3 seconds, -r 30 writes 30 frames per second, and the scale and crop fill 1080x1920. -shortest stops at the end of the pictures, and afade fades the music out over the last 2 seconds.

Variations

The other commands you will need

  1. A different length for each photo

    The concat demuxer reads a list with a duration per file. Set -t to the total as well: on ffmpeg 8.1 the list alone ran about a second over 15 s of durations, and with the last file listed a second time, about 3 seconds over.

    custom durations
    # list.txt
    file 'img01.jpg'
    duration 2
    file 'img02.jpg'
    duration 4
    file 'img03.jpg'
    duration 2
    file 'img04.jpg'
    duration 4
    file 'img05.jpg'
    duration 3
    
    ffmpeg -f concat -i list.txt -vf scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,format=yuv420p -r 30 -t 15 \
      -c:v libx264 -crf 20 -preset veryfast -movflags +faststart concat.mp4
  2. One picture over an audio track

    For a podcast clip or a song with cover art, loop the picture at 1 frame per second and let -t set the length. 20 seconds encode in a few seconds to about 1.3 MB.

    still with audio
    ffmpeg -loop 1 -framerate 1 -i cover.jpg -i music.mp3 -t 20 \
      -vf scale=1920:1080,format=yuv420p -c:v libx264 -tune stillimage -crf 20 -preset veryfast \
      -c:a aac -b:a 192k -movflags +faststart podcast.mp4
  3. Rendered frames back into a video

    Frames from a renderer or an earlier export go in at their real rate: -framerate 30 with a 4-digit pattern. 60 PNG frames make a 2-second clip in under a second.

    frames to video
    ffmpeg -framerate 30 -i seq/frame_%04d.png \
      -c:v libx264 -crf 20 -preset veryfast -pix_fmt yuv420p -movflags +faststart from-frames.mp4

The flags

The options in these commands

The options in these commands
FlagWhat it doesUsed here
-framerate 1/3Input rate of the image sequence: one picture per 3 seconds; the default is 25Slideshow
img%02d.jpgNumbered files: img01.jpg, img02.jpg and on, with no gapsSlideshow
-r 30Output frame rate; each photo is repeated to fill itSlideshow, concat
-shortestEnds the output with the shortest stream, here the picturesSlideshow
-f concatReads a list of files with a duration for eachCustom durations
-t 15Caps the output at 15 sCustom durations
-loop 1Repeats a single image for as long as the output needsStill with audio
-tune stillimagex264 tuning for pictures that do not moveStill with audio

Sources: ffmpeg formats: image2 and concat, ffmpeg documentation, checked November 2026.

Input rate and output rate

An image sequence has no timing of its own, so ffmpeg reads it at 25 pictures per second unless you say otherwise; five photos would flash past in a fifth of a second. -framerate 1/3 before -i stretches each one to 3 seconds.

A video at one frame every 3 seconds plays badly on phones and platforms, so -r 30 after the inputs repeats each photo to 30 fps. That is why the 15-second result has 450 frames.

The concat list and its extra seconds

A list with a duration per file gives each photo its own length. You will often read that the last file must be listed twice. On ffmpeg 8.1 that made our 15 s of durations run about 3 seconds long; without the repeat it still ran about a second over. Adding -t 15 gave exactly 15 seconds, so put the total in -t.

The list also needs the same size for every photo before it reaches the encoder, which the scale and crop in each command take care of.

Running it on the API

There is no folder to glob on the API: -pattern_type glob gets a 400 answer, "-pattern_type must be one of sequence, none". Give the photos numbered names in inputs and use the %02d pattern, as the job below does. A job takes up to 50 inputs.

If you want transitions, Ken Burns motion or a voiceover without writing filters, the slideshow API takes a list of photo URLs. Raw ffmpeg jobs are billed per compute second; see pricing.

Without installing ffmpeg

The same command as one API call

The keys in inputs are the file names ffmpeg sees, so name the photos to match the pattern. Each job runs ffmpeg 8.1 on a fresh machine at $0.02 per compute minute, billed per second; this one finished in about 20 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": {
      "img01.jpg": "https://api.reelsdk.com/f/lib/demo/seville/river.jpg",
      "img02.jpg": "https://api.reelsdk.com/f/lib/demo/seville/plaza.jpg",
      "img03.jpg": "https://api.reelsdk.com/f/lib/demo/seville/oranges.jpg",
      "img04.jpg": "https://api.reelsdk.com/f/lib/demo/seville/flamenco.jpg",
      "img05.jpg": "https://api.reelsdk.com/f/lib/demo/seville/tapas.jpg",
      "music.mp3": "https://api.reelsdk.com/f/lib/music/chill/calm-currents.mp3"
    },
    "args": [
      "-framerate", "1/3", "-i", "img%02d.jpg", "-i", "music.mp3", "-vf",
      "scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,format=yuv420p",
      "-r", "30", "-c:v", "libx264", "-crf", "20", "-preset", "veryfast",
      "-af", "afade=t=out:st=13:d=2", "-c:a", "aac", "-shortest",
      "-movflags", "+faststart", "slides.mp4"
    ],
    "outputs": ["slides.mp4"]
  }'
slides.mp4 from the API: 1080x1920, 15 seconds, about 1.8 MB.Input: first photomusic.mp3

FAQ

Questions, answered

How do I make a video from images with ffmpeg?

Name them in order, for example img01.jpg to img05.jpg, and run ffmpeg -framerate 1/3 -i img%02d.jpg -r 30 -c:v libx264 -pix_fmt yuv420p out.mp4. Each image shows for 3 seconds.

How do I set how long each image shows?

For the same length, set -framerate to 1 divided by the seconds, such as 1/3. For a different length per image, use a concat list with a duration line under each file and set -t to the total.

Why is my concat slideshow longer than the durations I set?

On ffmpeg 8.1 our 15 s of durations ran about a second over, and about 3 seconds over with the last file listed twice. Add -t with the total length to cut it exactly.

How do I add music that stops when the photos end?

Add the audio as a second input and pass -shortest. Fade it out with afade=t=out:st=13:d=2 for a 15-second video.

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