FFmpeg Recipe

Create thumbnails and preview images from video files

Generate single thumbnails at specific timestamps or create storyboard grids with multiple preview images. Perfect for video platforms, CMS systems, and media libraries.

Common thumbnail use cases

  • Video preview images for video players and CMS platforms
  • Social media thumbnails (YouTube, Vimeo, custom video platforms)
  • Storyboard grids showing multiple frames from a video
  • Sprite sheets for video scrubbing and timeline previews
  • Automatic thumbnail selection from the best frame (middle of video, or specific timestamp)

The raw FFmpeg command

To extract a single thumbnail at the 5-second mark with FFmpeg CLI:

ffmpeg -i input.mp4 -ss 00:00:05 -vframes 1 -q:v 2 thumbnail.jpg

-ss 00:00:05 seeks to 5 seconds, -vframes 1 extracts one frame, -q:v 2 sets JPEG quality (2 = high quality).

The API version

With FFmpeg Micro API, submit a job with the same parameters without managing FFmpeg installation or servers:

curl -X POST https://api.ffmpeg-micro.com/v1/jobs \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "https://example.com/input.mp4",
    "output": "thumbnail.jpg",
    "options": {
      "ss": "00:00:05",
      "vframes": 1,
      "q:v": 2
    }
  }'

The API returns a job ID. Poll /v1/jobs/:id or use webhooks to get the completed thumbnail URL.

{
  "id": "job_abc123",
  "status": "completed",
  "output_url": "https://storage.ffmpeg-micro.com/outputs/thumbnail.jpg"
}

Single thumbnail at a timestamp

Extract a thumbnail at a specific time (e.g., 10 seconds into the video):

{
  "input": "https://example.com/video.mp4",
  "output": "thumbnail-10s.jpg",
  "options": {
    "ss": "00:00:10",
    "vframes": 1,
    "q:v": 2
  }
}

For the middle of the video, use FFprobe to get the duration first, then calculate duration / 2 for the ss value.

Multiple thumbnails / storyboard

Generate a grid of thumbnails (e.g., 3x3 storyboard) with the tile filter:

{
  "input": "https://example.com/video.mp4",
  "output": "storyboard.jpg",
  "options": {
    "vf": "fps=1/10,scale=320:180,tile=3x3",
    "frames:v": 1
  }
}

fps=1/10 extracts 1 frame every 10 seconds, scale=320:180 resizes each thumbnail, tile=3x3 arranges them in a 3-by-3 grid.

Best dimensions and formats

Formats: JPEG (.jpg) for photos and thumbnails, PNG (.png) if you need transparency, WebP (.webp) for smaller file sizes with good quality.

Common dimensions:

  • YouTube thumbnail: 1280x720 (16:9)
  • Instagram square: 1080x1080 (1:1)
  • Video player preview: 640x360 or 320x180 (16:9)
  • Storyboard tiles: 160x90 or 320x180 per tile

Use scale=1280:720 in the vf (video filter) option to set dimensions, or scale=-1:720 to maintain aspect ratio with height fixed at 720px.

Output naming conventions

When generating multiple thumbnails from one video, use descriptive filenames:

  • video-id-thumbnail-5s.jpg — thumbnail at 5 seconds
  • video-id-thumbnail-middle.jpg — middle frame
  • video-id-storyboard-3x3.jpg — 3x3 grid preview
  • video-id-sprite-sheet.jpg — sprite sheet for scrubbing UI

Related recipes

Ready to generate thumbnails?

Start with 100 free minutes of video processing. No FFmpeg installation required.