Extract a thumbnail from a video

Grabs a single frame as a JPEG or PNG, seeking to the timestamp first so it is fast on long files.

ffmpeg -ss 2 -i https://cdn.rendobar.com/assets/examples/sample.mp4 -frames:v 1 -q:v 2 out.jpg
Encode
127 ms
Output
49.8 KB
Cost
$0.0014
Result
1280x720

job_1563ceb5d68f4ca5

The part everyone gets wrong

-frames:v 1 stops after one frame. Without it, and without -vframes, FFmpeg happily writes a numbered sequence of every frame in the file. -q:v runs 2 (best) to 31 (worst) for JPEG, which is the opposite direction to CRF.

What the common version does

Seeking after the input decodes every frame up to the timestamp, which is wasted work when you want one picture.

ffmpeg -i https://cdn.rendobar.com/assets/examples/sample.mp4 -ss 2 -frames:v 1 -q:v 2 out.jpg
It succeeds, and that is the problem

It did not error. It produced 49.8 KB against the correct command's 49.8 KB, a 1.0x smaller file. A pipeline would accept this silently.

job_42f0f069da954a05

Frequently asked questions

How do I extract thumbnail from video?

Grabs a single frame as a JPEG or PNG, seeking to the timestamp first so it is fast on long files.

What goes wrong most often?

-frames:v 1 stops after one frame. Without it, and without -vframes, FFmpeg happily writes a numbered sequence of every frame in the file. -q:v runs 2 (best) to 31 (worst) for JPEG, which is the opposite direction to CRF.

What happens if I get it wrong?

We ran the naive version too. It did not error. It produced 49.8 KB against the correct command's 49.8 KB, a 1.0x smaller file. A pipeline would accept this silently.

Do I need FFmpeg installed?

Not with Rendobar. The command on this page ran through the API against a URL, with no local FFmpeg and no server. The job id below it is the job that produced these numbers.

Run this without installing FFmpeg

This exact command ran through the API against a URL.