-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
ffmpeg -i in.mp4 -vf fps=1 -q:v 2 frame_%02d.jpgThe 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
Every 30th frame
selectwithmod(n,30)keeps frames 0, 30, 60 and on, counted from the source, not by time.-fps_mode vfrwrites 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.jpgFrames 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.jpgEvery 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
| Flag | What it does | Used here |
|---|---|---|
fps=1 | Keeps 1 frame per second of video | Per second |
frame_%02d.jpg | Numbered file names; %04d for longer runs | Per second, all frames |
-q:v 2 | JPEG quality; lower is better | Per second, Nth, exact times |
not(mod(n,30)) | A select test that keeps every 30th frame by number | Every Nth |
-fps_mode vfr | Writes only the selected frames, without duplicates | Every Nth |
-ss 1.5 | Before -i: seeks that input to the exact time | Exact times |
-update 1 | Treats the name as one file, not a numbered pattern | Exact times |
-frames:v 20 | Stops after 20 frames; the API needs 20 or fewer for a pattern | API 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.
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"
]
}'
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.
- Video thumbnails with ffmpegGrab a frame at a time, let the thumbnail filter pick a good one, or pull keyframes and scene changes as JPEGs.
- Make a contact sheet from a video with ffmpegTile frames from a clip into one preview image with select, scale and tile, and stamp each tile with its time.
- Video to GIF with ffmpegMake a clean GIF from a video with palettegen and paletteuse, then shrink it with frame rate, size, colours or a different format.
- Images to video with ffmpegTurn photos into an MP4 slideshow with music: frame rate per photo, a concat list for custom durations, and one still with audio.
- Trim a video with ffmpegCut a clip with -ss and -to: frame-exact with a re-encode, fast with -c copy, and why the copy starts before your time.
- Video thumbnailsGrab a poster frame and a contact sheet with one frame per shot from one ffmpeg call, under a fifth of a cent for both.
- FFmpeg onlineRun your own ffmpeg command on your files in the browser, free and without installing or uploading anything.
- ffmpeg exited with code 1: Conversion failed!fluent-ffmpeg reports only ffmpeg's exit code and last line. The real cause is in stderr: print it, or use -v error to see it alone.
- ReelSDK vs self-hosted FFmpegTranscoding a minute of 1080p to 720p takes about 24 seconds of compute: about 0.8 cents on ReelSDK, about a tenth of a cent on a busy 4 vCPU box. Below about 11,000 minutes a month, the API costs less than an always-on box.
Sources, checked November 2026
Ready to build?
Ship video from your app today
Your first $0.50 is free, and one key covers every endpoint.
