Ffmpeg Frames Images
Context: $ARGUMENTS
Frame extraction and image I/O with ffmpeg: single stills, periodic frame dumps, contact sheets, sprite sheets for scrubbers, high-quality GIFs, and building video back from an image sequence.
Quick start
- Single screenshot at a timestamp → Step 1 (screenshot) + Step 2
- Dump N frames per second to PNG/JPG → Step 1 (sequence) + Step 2
- Contact sheet / thumbnail grid → Step 1 (sheet) + Step 2
- Sprite sheet for HLS scrubber → Step 1 (sprite) + Step 2
- High-quality GIF from video → Step 1 (gif) + Step 2 (two-pass)
- Build video from PNG/JPG sequence → Step 1 (images-to-video) + Step 2
When to use
- Grab a poster/thumbnail frame at a specific time.
- Produce preview grids (contact sheet) for a long video.
- Generate scrubber sprites for a web player (HLS/DASH image tracks).
- Export frames for ML, computer vision, or VFX pipelines.
- Make a looping GIF for docs/social without visible banding.
- Re-encode a rendered image sequence (e.g. Blender/Nuke output) into MP4.
Step 1 — Pick your output
Choose exactly one shape; each has its own command pattern.
screenshot— one still image at a timestamp.sequence— many images at regular intervals (fps=1= 1/sec,fps=1/10= every 10s).sheet— one image that is a grid (tile=MxN) of stamps across the video.sprite— same as sheet but sized for a web player's scrubber.gif— animated GIF (two-command palette workflow).images-to-video— reverse direction: image sequence → MP4.thumbnail-smart— let ffmpeg pick a "representative" frame.keyframes-only— export only frames marked as keyframes.
Step 2 — Build the command
2a. Single screenshot at 1:30
# Input-side seek is FAST (keyframe-snapped, may be a few ms off).
ffmpeg -ss 00:01:30 -i in.mp4 -vframes 1 -q:v 2 out.jpg
# Frame-accurate (SLOW, decodes from 0):
ffmpeg -i in.mp4 -ss 00:01:30 -vframes 1 -q:v 2 out.jpg
# Lossless PNG instead of JPG:
ffmpeg -ss 90 -i in.mp4 -vframes 1 -c:v png out.png
2b. One frame per second (or every N seconds)
# 1 frame / second:
ffmpeg -i in.mp4 -vf fps=1 frame_%04d.jpg
# 1 frame / 10 seconds:
ffmpeg -i in.mp4 -vf fps=1/10 frame_%04d.jpg
# Higher JPG quality (2 = best, 31 = worst):
ffmpeg -i in.mp4 -vf fps=1 -q:v 2 frame_%04d.jpg
2c. Contact sheet 4x4 at 5-second intervals
ffmpeg -i in.mp4 \
-vf "fps=1/5,scale=320:-1,tile=4x4" \
-frames:v 1 sheet.jpg
2d. Sprite sheet for HLS scrubber (10x10 grid, 10s interval, 160px wide)
ffmpeg -i in.mp4 \
-vf "fps=1/10,scale=160:-1,tile=10x10" \
-frames:v 1 sprites.jpg
Each sprite cell is 160 x (160/aspect). For a 16:9 video that's 160x90. With 100 cells and a 10s interval you cover 1000 seconds of runtime per sheet. See