How to Extract Every 10th Frame Using FFmpeg

This article provides a quick, step-by-step guide on how to use the FFmpeg command-line tool to extract every 10th frame from a video file and save them as a sequentially numbered series of JPEG images. You will learn the exact command to use and how each parameter works to customize the output for your project.

To extract every 10th frame from a video, open your terminal or command prompt and run the following FFmpeg command:

ffmpeg -i input.mp4 -vf "select='not(mod(n,10))'" -vsync vfr output_%04d.jpg

Command Breakdown

Adjusting Image Quality

By default, FFmpeg exports JPEGs with a medium quality level. If you want to maximize the quality of the exported JPEG images, add the -q:v (or -qscale:v) option set to a low value, where 2 represents high quality:

ffmpeg -i input.mp4 -vf "select='not(mod(n,10))'" -vsync vfr -q:v 2 output_%04d.jpg