6

I want to take a frame of a video at a certain percentage of time (for example, 25%, 50% and 75%) and save it somewhere.

I need this to be done from the command-line so I can automate it. Also, this needs to be done in Windows.

Does anyone know how to do this?

Pylsa
  • 31,383
brott
  • 137
  • 2
  • 5

1 Answers1

4

You might want to use ffmpeg for Windows with the following command:

ffmpeg -i <INPUT FILE> -ss 10 -f image2 -r 25 <OUTPUT FILE>
  • -i <INPUT FILE> Specifies the input file. E.g. movie.mp4.
  • -ss <TIME> Specifies time position in seconds. "hh:mm:ss[.xxx]" is also supported.
  • -f image2 Force/Set format.
  • -r 25 Set frame rate (in Hz. Can either be a fraction or a number, default = 25).
  • <OUTPUT FILE> Set output file. E.g. image1.jpg.

If your source video has a fixed frame rate, you can capture a specific frame using this formula:

<FRAME NUMBER> / <FRAME RATE> = <NUMBER OF SECONDS>

So if you want to capture frame 250 at a 25Hz frame rate, you set -ss to 10.

slhck
  • 235,242
Pylsa
  • 31,383