Use

ffmpeg -i "%1" frames/out-%03d.jpg

A sequence of image files don't have a framerate. If you want to undersample the video file, use -r before the input.

Edit:

ffmpeg -i "C:\Applications\FFMPEG\aa.mp4" "frames/out-%03d.jpg"
Answer from Gyan on Stack Overflow
🌐
OTTVerse
ottverse.com › home › ffmpeg › extract frames using ffmpeg: a comprehensive guide
Extract Frames using FFmpeg: A Comprehensive Guide - OTTVerse
August 21, 2023 - Lastly, let’s address a slightly more complex scenario – extracting an exact frame at a specific timestamp. The following command does just that: ffmpeg -ss 00:01:00 -i input.mp4 -frames:v 1 output.png
Discussions

video - Fastest way to extract frames using ffmpeg? - Stack Overflow
You mean ffmpeg -r 1 -i file.mp4 -r 1 "$filenamed.png, right? (you were missing the -i) 2020-01-23T19:00:15.443Z+00:00 ... Came across this question, so here's a quick comparison. Compare these two different ways to extract one frame per minute from a video 38m07s long: More on stackoverflow.com
🌐 stackoverflow.com
ffmpeg - Extracting frames from MP4/FLV? - Stack Overflow
I know it's possible with FFMPEG, but what to do if I have a partial file (like without the beginning and the end). Is is possible to extract some frames from it? More on stackoverflow.com
🌐 stackoverflow.com
How to extract frames from a video using ffmpeg? - Video Production Stack Exchange
Basically I want to extract all frames from the video where the images will be resized to be 720p. All of this I know how to do. But for testing I want to extract every Nth frame. So every 30th image More on video.stackexchange.com
🌐 video.stackexchange.com
June 1, 2024
Extract specific video frames - Video Production Stack Exchange
You can do it manually: ffmpeg -i in.mp4 -vf select='between(n,x,y)' -vsync 0 -start_number x frames%d.png ... @Gyan I came to know of this from an another similar answer of yours. Please do edit it for other users convenience. I have the latest ffmpeg version. ... where XXX is the time in seconds. If you know which exactly frame you want to extract ... More on video.stackexchange.com
🌐 video.stackexchange.com
People also ask

How do I extract frames from a specific time range?
Combine -ss (start) with -t (duration):
ffmpeg -ss 00:01:00 -i input.mp4 -t 10 -vf "fps=1" range_%03d.jpg
This extracts one frame per second from the 1:00 to 1:10 mark.
🌐
ffmpeg-micro.com
ffmpeg-micro.com › blog › how to extract frames from video with ffmpeg
How to Extract Frames from Video with FFmpeg | FFmpeg Micro
Can I extract frames as PNG instead of JPEG?
Yes. Change the extension to .png. FFmpeg picks the encoder from the file extension. PNG is lossless but much larger. The same frame that was 23KB as JPEG was 269KB as PNG. About 11x bigger.
ffmpeg -ss 5 -i input.mp4 -frames:v 1 frame.png
🌐
ffmpeg-micro.com
ffmpeg-micro.com › blog › how to extract frames from video with ffmpeg
How to Extract Frames from Video with FFmpeg | FFmpeg Micro
Is JPEG or PNG better for extracted frames?
JPEG for most cases. It's 10x smaller (23KB vs 269KB for the same 640x360 frame) and good enough for thumbnails, preview images, and visual inspection. Use PNG only when you need lossless pixel data for machine learning training sets or when frames feed into another image processing pipeline.
🌐
ffmpeg-micro.com
ffmpeg-micro.com › blog › how to extract frames from video with ffmpeg
How to Extract Frames from Video with FFmpeg | FFmpeg Micro
🌐
Shotstack
shotstack.io › home › learn › use ffmpeg to extract frames from video
Use FFmpeg to extract frames from video — Shotstack
March 26, 2024 - ffmpeg -i input.mp4 ss 0:00:00 -frames:v 1 first.jpg · By default, if you don’t specify any timestamp, FFmpeg will extract the first frame.
🌐
Gumlet
gumlet.com › learn › ffmpeg-extract-frames
How to extract frames from video using FFmpeg? - Gumlet
July 3, 2024 - You can create a shell script to process multiple videos in a directory: #!/bin/bash for file in /path/to/videos/*.mp4; do ffmpeg -i "$file" -vf fps=1 /path/to/frames/"$(basename "$file" .mp4)"_d.png done
🌐
Baeldung
baeldung.com › home › scripting › extracting frames from a video using ffmpeg
Extracting Frames From a Video Using FFmpeg | Baeldung on Linux
March 18, 2024 - We can also extract multiple frames from the desired time offset. Let’s extract 25 frames from the video starting at five seconds with the rate of 10 frames per second: $ ffmpeg -i big_buck_bunny_720p_2mb.mp4 -ss 00:00:05 -r 10 -s 640x360 -q:v 2 -vframes 25 framed.jpg
Find elsewhere
🌐
GitHub
gist.github.com › loretoparisi › a9277b2eb4425809066c380fed395ab3
Extract all frames from a movie using ffmpeg · GitHub
@illtellyoulater Just skip the frame rate parameters. It should look something like this: ffmpeg -i input.mkv outd.png ... If you have an HDR movie, you can extract high quality images using: ffmpeg -i HDR.mov -vf zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p 'd.png'
Top answer
1 of 2
90

The command

ffmpeg -ss 00:00:25 -t 00:00:00.04 -i YOURMOVIE.MP4 -r 25.0 YOURIMAGE%4d.jpg

will extract frames

  • beginning at second 25 [-ss 00:00:25]
  • stopping after 0.04 second [-t 00:00:00.04]
  • reading from input file YOURMOVIE.MP4
  • using only 25.0 frames per second, i. e. one frame every 1/25 seconds [-r 25.0]
  • as JPEG images with the names YOURIMAGE%04d.jpg, where %4d is a 4-digit autoincrement number with leading zeros

Check you movie for the framerate before applying option [-r], same applicable for [-t], unless you want to extract the frames with the custom rate.

Never tried this with the cropped (corrupted?) input file though. Worth to try.

2 of 2
2

This could be VERY difficult. The MP4 file format includes an 'moov' atom which has pointers to the audio and video 'samples'. If the fragment of the mp4 file you have does not have the moov atom, your job would be much more complicated. You'd have to develop logic to examine the 'mdat' atom (which contains all the audio and video samples) and use educated guesses to find the audio and video boundaries.

Even worse, without the moov atom, you won't have the SPS and PPS needed to decode the slices. You'd have to synthesize replacements; if you know the codec used to create the MP4, then you might be able to copy the SPS and PPS from a similarly encoded file; if not, it could be a painful process of trial and error, because the syntax of the slices (the H.264 encoded pictures) is dependent upon values specified in the SPS and PPS.

🌐
FFmpeg Micro
ffmpeg-micro.com › blog › how to extract frames from video with ffmpeg
How to Extract Frames from Video with FFmpeg | FFmpeg Micro
May 16, 2026 - If you don't need every frame and just want the visually significant ones, extract keyframes (I-frames). These are fully encoded frames that mark scene changes or major visual shifts. ffmpeg -i input.mp4 -vf "select='eq(pict_type,I)'" -vsync vfr keyframe_d.jpg
🌐
Stack Exchange
video.stackexchange.com › questions › 37503 › how-to-extract-frames-from-a-video-using-ffmpeg
How to extract frames from a video using ffmpeg? - Video Production Stack Exchange
June 1, 2024 - Also the extracted image filenames ... 0 · This is actually pretty trivial: ffmpeg -i test.mp4 -r 1 -an -c:v mjpeg 'testd.jpeg' This will extract 1 frame per second....
🌐
Creatomate
creatomate.com › blog › how-to-extract-images-from-a-video-using-ffmpeg
How to Extract Images From a Video using FFmpeg - Creatomate
October 17, 2022 - Use the following command to extract frames from a video. This extracts all frames using the pattern frame0001.png, frame0002.png, and so on. $ ffmpeg -i input.mp4 framed.png
🌐
Medium
hansheng0512.medium.com › extract-frames-from-video-with-ffmpeg-in-one-minute-526da15090ec
Extract Frames From Video with FFmpeg in One Minute | by Liang Han Sheng | Medium
December 25, 2022 - ffmpeg -i video.mp4 -vf fps=2 outputd.png · And fps=1/10 will extract 1 frame per 10 seconds. ffmpeg -i video.mp4 -vf fps=1/10 outputd.png · To read more about the FFmpeg, feel free to checkout their documentation. Here is a quick demo. Demo (Video source) https://github.com/FFmpeg/FFmpeg ·
🌐
FFmpeg Cookbook
ffmpeg-cookbook.com › home › video conversion › extract frames from video with ffmpeg — save as png or jpg
Extract Frames from Video with FFmpeg — Save as PNG or JPG
June 27, 2026 - To get the frame at a specific time, put -ss before -i. This saves the frame at 5 seconds: ffmpeg -ss 00:00:05 -i input.mp4 -frames:v 1 output.png
🌐
YouTube
youtube.com › watch
The Fastest Way to Get Frames from Video (FFmpeg, Windows Guide) - YouTube
Two steps, no fluff: install FFmpeg on Windows, then run one command to extract frames from any video. This works for MP4 and iPhone footage, and is perfect ...
Published: August 14, 2025
🌐
GetVideoFrames
getvideoframes.com › home › guides › extract frames with ffmpeg
Extract Frames with FFmpeg — Complete Guide
July 13, 2026 - Use the fps filter: ffmpeg -i input.mp4 -vf fps=1 frames/out_d.jpg. For one frame every 5 seconds use fps=1/5. Create the output folder first. ... Use PNG when a lossless image format is appropriate for the work.
🌐
YouTube
youtube.com › watch
ffmpeg tutorial export every nth frame as image - YouTube
Learn how to efficiently extract specific frames from an MP4 video using FFmpeg in this step-by-step tutorial. Whether you need to export every 10th, 30th, o...
Published: January 22, 2025
🌐
Bannerbear
bannerbear.com › blog › how-to-extract-images-from-a-video-using-ffmpeg
How to Extract Images from a Video Using FFmpeg - Bannerbear
November 18, 2024 - To extract only an image at a given time like how you would normally take a screenshot, add -frames:v 1 to the command. This will output a single frame at the time specified. For example, this command will output a single frame at 00:04 of the ...
🌐
npm
npmjs.com › package › ffmpeg-extract-frames
ffmpeg-extract-frames - npm
December 23, 2018 - Extracts frames from a video using fluent-ffmpeg. npm install --save ffmpeg-extract-frames · # or · yarn add ffmpeg-extract-frames · const extractFrames = require('ffmpeg-extract-frames') // extract 3 frames at 1s, 2s, and 3.5s respectively ...
      » npm install ffmpeg-extract-frames
    
Published: Dec 23, 2018
Version: 2.0.2