Extract Single Frame as High-Quality PNG with FFmpeg

This article demonstrates how to use the FFmpeg command-line tool to extract a single, frame-accurate image from a video at a specific timestamp. You will learn the exact command structure required to output a high-quality, lossless PNG image, along with an explanation of how each parameter works to ensure the best possible visual quality.

The Standard Command

To extract a single frame at a specific timestamp, use the following FFmpeg command:

ffmpeg -ss 00:01:30 -i input.mp4 -frames:v 1 output.png

Parameter Breakdown


Ensuring Frame Accuracy

Placing the -ss parameter before the -i parameter is highly efficient because it skips to the timestamp quickly. However, this can sometimes result in a slightly inaccurate frame capture depending on the video’s keyframe placement.

If you need absolute, frame-accurate precision, place the -ss parameter after the input file:

ffmpeg -i input.mp4 -ss 00:01:30 -frames:v 1 output.png

Note: This method is slower because FFmpeg must decode the video from the beginning up to the specified timestamp, but it guarantees you get the exact frame requested.


Optimizing for Maximum Quality and Color Accuracy

Because PNG is a lossless format, FFmpeg will preserve the source quality by default. However, video files and image files often use different color spaces (YUV vs. RGB). To prevent color degradation or shifting during conversion, force FFmpeg to output a high-quality RGB pixel format using the -pix_fmt flag:

ffmpeg -ss 00:01:30 -i input.mp4 -frames:v 1 -pix_fmt rgb24 output.png