-vf fps=1 frame_%02d.jpg saves one JPEG per second: 10 stills from a 10-second clip, under 4 MB in all, while every frame as PNG came to over 600 MB. ReelSDK returns up to 20 frames per job for $0.02 per compute minute.

Convert a video into images with ffmpeg

First decide how many frames you need: 10 seconds of 30 fps video holds about 300, and ReelSDK's API stops a numbered sequence at 20 per job. Take one per second with fps, every Nth with select, or exact times with -ss.

GuidesUpdated

per second
ffmpeg -i in.mp4 -vf fps=1 -q:v 2 frame_%02d.jpg

The fps filter drops frames until 1 per second is left, and %02d numbers the files from frame_01.jpg. JPEG at -q:v 2 came to under 4 MB for 10 frames of HD; the same frames as PNG were over five times bigger and took almost three times as long.

Variations

The other commands you will need

  1. Every 30th frame

    select with mod(n,30) keeps frames 0, 30, 60 and on, counted from the source, not by time. -fps_mode vfr writes only those frames, so 30 fps video gives 1 file per second.

    every Nth
    ffmpeg -i in.mp4 -vf "select='not(mod(n,30))'" -fps_mode vfr -q:v 2 n_%02d.jpg
  2. Frames at exact times

    Open the file once per time with its own -ss, and map each input to its own output. Both stills come out of one run in about a second.

    exact times
    ffmpeg -ss 1.5 -i in.mp4 -frames:v 1 -update 1 -q:v 2 at1.jpg \
      -ss 6 -i in.mp4 -map 1:v -frames:v 1 -update 1 -q:v 2 at6.jpg
  3. Every frame

    No filter at all writes every frame. On our 10-second clip that was over 600 MB of PNG and more than a minute of work. Use it for frame-by-frame work, not for previews.

    all frames
    ffmpeg -i in.mp4 all_%04d.png

The flags

The options in these commands

The options in these commands
FlagWhat it doesUsed here
fps=1Keeps 1 frame per second of videoPer second
frame_%02d.jpgNumbered file names; %04d for longer runsPer second, all frames
-q:v 2JPEG quality; lower is betterPer second, Nth, exact times
not(mod(n,30))A select test that keeps every 30th frame by numberEvery Nth
-fps_mode vfrWrites only the selected frames, without duplicatesEvery Nth
-ss 1.5Before -i: seeks that input to the exact timeExact times
-update 1Treats the name as one file, not a numbered patternExact times
-frames:v 20Stops after 20 frames; the API needs 20 or fewer for a patternAPI job

Sources: ffmpeg filters: fps, select, ffmpeg formats: image2 muxer, checked November 2026.

JPEG or PNG

PNG keeps every pixel, and it costs you. Our 10 HD frames were over five times bigger as PNG than as JPEG at -q:v 2, and took almost three times as long to write. Use PNG when the frames feed another tool that edits pixels, JPEG for previews and datasets.

Raise -q:v for smaller files; the API job uses 3, and its full-HD frames came out under half a megabyte each.

The 20-frame rule on the API

On POST /v1/ffmpeg, a numbered image pattern needs -frames:v 20 or less. Leave it out and the request gets a 400 before any work starts: "image sequences need -frames:v 20 or fewer". Ask for 21 and you get the same answer.

outputs cannot hold the pattern either. Names must match ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$, which has no room for %, so frame_%02d.jpg there gets "invalid output filename". List each file by the name ffmpeg writes. A job takes up to 20 output names, the same as the frame limit.

More than 20 frames

Split the video by time and send one job per part, each with its own -ss and -t and up to 20 frames. A key runs 3 jobs at once, so 3 parts finish in about the time of one; a fourth gets 429 RATE_LIMITED with a Retry-After header until one is done. Each is billed per compute second; see pricing.

For a single preview image with many frames on it, a contact sheet tiles them into one JPEG, which counts as one output.

Without installing ffmpeg

The same command as one API call

The pattern stays in args, and each file it writes goes in outputs by name, frame_01.jpg to frame_20.jpg. 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": {
      "in.mp4": "https://api.reelsdk.com/f/lib/demo/landscape.mp4"
    },
    "args": [
      "-i", "in.mp4", "-vf", "fps=2", "-frames:v", "20", "-q:v", "3",
      "frame_%02d.jpg"
    ],
    "outputs": [
      "frame_01.jpg", "frame_02.jpg", "frame_03.jpg", "frame_04.jpg",
      "frame_05.jpg", "frame_06.jpg", "frame_07.jpg", "frame_08.jpg",
      "frame_09.jpg", "frame_10.jpg", "frame_11.jpg", "frame_12.jpg",
      "frame_13.jpg", "frame_14.jpg", "frame_15.jpg", "frame_16.jpg",
      "frame_17.jpg", "frame_18.jpg", "frame_19.jpg", "frame_20.jpg"
    ]
  }'
ReelSDK video API: Frame 10 of 20: the Plaza de Espana in Seville
frame_10.jpg, one of 20 JPEGs from the API at 2 frames per second.Input: 1920x1080 inputframe_01.jpgframe_05.jpgframe_15.jpgframe_20.jpg

FAQ

Questions, answered

How do I extract one frame per second with ffmpeg?

Run ffmpeg -i in.mp4 -vf fps=1 -q:v 2 frame_%02d.jpg. Our 10-second clip gave 10 JPEGs in about a second and a half.

How do I extract every frame from a video?

Run ffmpeg -i in.mp4 all_%04d.png with no filter. Expect a lot of data: 10 seconds of HD came to over 600 MB.

Why does the API refuse my frame extraction request?

Either the pattern has no -frames:v of 20 or less, or outputs holds a name with %. Add -frames:v 20 and list each file, frame_01.jpg to frame_20.jpg, in outputs.

How do I get frames at specific times?

Give each time its own -ss before its own -i, map each input with -map and write each with -frames:v 1 -update 1.

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