Convert Video Frames to AVIF Using FFmpeg

This guide explains how to convert video frames into high-efficiency AVIF images using FFmpeg. You will learn the exact command-line parameters required to extract single frames, export image sequences, and optimize output quality and encoding speed using the AV1 codec.

Basic Command to Extract a Single Frame to AVIF

To extract a single frame from a video at a specific timestamp and save it as an AVIF image, use the following syntax:

ffmpeg -ss 00:00:10 -i input.mp4 -frames:v 1 -c:v libaom-av1 -still-picture 1 output.avif

Essential Command-Line Parameters

High-Quality Single Frame Extraction

To obtain an archival-quality still frame with balanced compression speed, combine the parameters as follows:

ffmpeg -ss 00:01:30 -i input.mp4 -frames:v 1 -c:v libaom-av1 -still-picture 1 -crf 20 -b:v 0 -cpu-used 4 -pix_fmt yuv420p frame.avif

Exporting Multiple Frames or an Image Sequence

To export multiple frames across the entire video or a specific segment, omit -still-picture 1 (as it is restricted to single-frame files) and define an output pattern:

Extracting Every Frame:

ffmpeg -i input.mp4 -c:v libaom-av1 -crf 24 -b:v 0 -cpu-used 6 frame_%04d.avif

Extracting at a Set Frame Rate (e.g., 1 frame per second):

ffmpeg -i input.mp4 -vf "fps=1" -c:v libaom-av1 -crf 24 -b:v 0 -cpu-used 6 frame_%04d.avif

The %04d placeholder creates zero-padded sequential numbers (frame_0001.avif, frame_0002.avif, etc.) for each exported image.